Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Tue Jul 16, 2019 1:44 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: plugin:mikrotik - PHP escape character
PostPosted: Thu Oct 24, 2013 12:55 am 
Offline
User avatar

Joined: Mon Dec 20, 2004 3:13 am
Posts: 45
Location: The Netherlands
Dear Cacti users,

I am using http://docs.cacti.net/plugin:mikrotik#mikrotik with cacti Version 0.8.8b.

I am seeing the following on the cacti.log file

Quote:
10/24/2013 07:25:01 AM - SPINE: Poller[0] Host[798] Description[APXXX001] ERROR: Empty result [APXXX001.bla.local]: '/usr/bin/snmpwalk APXXX001.bla.local -Cc -v 1 -c nevermind 1.3.6.1.2.1.4.22.1.2 | /bin/wc -l | /bin/awk \'{printf$0}\''
10/24/2013 07:25:01 AM - SPINE: Poller[0] Host[798] Description[APXXX001] ERROR: Empty result [APXXX001.bla.local]: '/usr/bin/snmpwalk APXXX001.bla.local -Cc -v 1 -c nevermind .1.3.6.1.4.1.14988.1.1.1.2.1.3 | /bin/wc -l | /bin/awk \'{printf$0}\''


I found out that the problem is with the \'{printf$0}\' bit. I should be '{printf$0}'

When I look at the "Console -> Data Input Methods -> Unix - Count Oids", the input string says: "/usr/bin/snmpwalk <ip> -Cc -v <ver> -c <comm> <oid> | /bin/wc -l | /bin/awk '{printf$0}'". The PHP escape characters are added automatically by Cacti in a later stage but should not end up at the final prompt as it does now.

Can someone provide a workaround or even a fix for this problem?

_________________
Cacti Version - 0.8.8b
CentOS 6.4


Top
 Profile  
 
 Post subject: Re: plugin:mikrotik - PHP escape character
PostPosted: Tue Oct 29, 2013 12:41 am 
Offline
User avatar

Joined: Mon Dec 20, 2004 3:13 am
Posts: 45
Location: The Netherlands
:o Anyone...
Please...

This is a new and fresh installation of Cacti and CentOS. I have a ton of plugins installed so far and everything seems oke except for the problem mentioned above.

_________________
Cacti Version - 0.8.8b
CentOS 6.4


Top
 Profile  
 
 Post subject: Re: plugin:mikrotik - PHP escape character
PostPosted: Tue Oct 29, 2013 6:04 am 
Offline
User avatar

Joined: Mon Dec 20, 2004 3:13 am
Posts: 45
Location: The Netherlands
I fixed it myself the dirty way :-?

Placed a bash script in the cacti scripts directory.
Code:
#!/bin/bash
#
# Cacti Data Input Method: Unix - Count Oids
# Origional command: /usr/bin/snmpwalk <ip> -Cc -v <ver> -c <comm> <oid> | /bin/wc -l | /bin/awk '{printf$0}'

export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"

/usr/bin/snmpwalk $1 -Cc -v $2 -c $3 $4 | /bin/wc -l | /bin/awk '{printf$0}'


Then, changed the "Unix - Count Oids" to
Code:
"bash <path_cacti>/scripts/unix_count_oids_fix.sh <ip> <ver> <comm> <oid>"

_________________
Cacti Version - 0.8.8b
CentOS 6.4


Top
 Profile  
 
 Post subject: Re: plugin:mikrotik - PHP escape character
PostPosted: Fri Sep 09, 2016 3:32 am 
Offline

Joined: Mon Jul 18, 2016 7:41 am
Posts: 2
Gracias :lol: me sirvió


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group