Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Fri Dec 15, 2017 8:37 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 71 posts ]  Go to page Previous  1, 2, 3, 4, 5
Author Message
 Post subject:
PostPosted: Mon Mar 23, 2009 10:11 am 
Offline
Cacti User

Joined: Fri Dec 09, 2005 3:42 pm
Posts: 246
I've uploaded a new version of the script that addresses some of the problems that have been reported. The script should now work with 0.8.6 and 0.8.7 and should not NAN as often. However it does not currently support the 0.8.7 SNMPv3 interface due to command-line length restrictions in Cacti. I will try to rearchitect and fix this in the next update.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 21, 2009 6:14 pm 
Offline
Cacti User

Joined: Fri Dec 09, 2005 3:42 pm
Posts: 246
I posted a new version of the script with many significant enhancements. The biggest change is a switch from the expensive and slow script query interface to the persistent and fast script server interface. I also dropped the comma-separated parameters and switched to a colon-separated "bundle" for SNMP arguments, tightened up the array and variable management, added a lot more error checking, and otherwise did a complete rewrite of the script.

Due to the changes, the script and resource xml files need to be reinstalled and any data queries need to be reimported. However the existing graphs and data sources should continue to operate afterwards.

I've also moved the files to this page on my web server so that I can more easily maintain them


Top
 Profile  
 
 Post subject: issues when running via poller, but command line works
PostPosted: Thu Jul 16, 2009 10:57 am 
Offline

Joined: Thu Jul 16, 2009 10:52 am
Posts: 2
First off, thank you for writing the xml template as well as the script. I can get it to run on the command line, but when it is executed via Cacti, I get the following:

SERVER: /usr/share/cacti/scripts/ss_netsnmp_memory.php ss_netsnmp_memory hostname:2:community:admin:test:MD5::DES::161:500, output: Syntax: ss_netsnmp_memory.php <hostname>:<snmp_version>:[<snmp_community>]:\

php /usr/share/cacti/scripts/ss_netsnmp_memory.php hostname:2:community:admin:test:MD5::DES::161:500
totalReal:2072640 availReal:1240436 totalSwap:2031608 availSwap:1801524 memBuffer:47900 memCached:673392 usedReal:110912 usedSwap:230084


I am stumped, and I was wondering if you could give some guidance, if it's not too troubling.

cacti version 0.8.7d
php 5.1


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 17, 2009 4:58 am 
Offline
Cacti User

Joined: Sun May 27, 2007 5:42 pm
Posts: 175
Hi bunkzilla

Since you are using cacti 0.8.7d, there is a bug regarding about importing scripts.
See this:
http://forums.cacti.net/about32035.html&highlight=

Please double check your "Data Input Methods" for the "ucd/net - Memory Usage"

The correct "Input String" should be:
<path_cacti>/scripts/ss_netsnmp_memory.php ss_netsnmp_memory <hostname>:<snmp_ver>:<snmp_community>:<snmp3_username>:<snmp3_password>:<snmp3_authprot>:<snmp3_privpass>:<snmp3_privprot>:<snmp3_context>:<snmp_port>:<snmp_timeout>


Take note that I now using cacti 0.8.7e and it still has the same bug.

SH


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 17, 2009 1:15 pm 
Offline

Joined: Thu Jul 16, 2009 10:52 am
Posts: 2
I have verified my data input string is what is specified above. I guess because I cut and paste to do the import, I did not run into the issue with the missing <>

Any other suggestions on what this could be?

I'm going to try to add some debugging lines to the php script to see what exactly it is receiving.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 25, 2009 8:28 am 
Offline
Cacti User

Joined: Fri Dec 09, 2005 3:42 pm
Posts: 246
What's weird to me is that you get the syntax message without a preceding error. Every call of the syntax function is preceded by an error, so if you are getting the syntax message WITHOUT an error then you are apparently falling into the syntax function from the main function without getting an error. Did you edit the script?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 26, 2010 5:35 am 
Offline

Joined: Tue Jan 26, 2010 5:34 am
Posts: 4
Version 0.8.7e - Runs like a charm! Very nice work!


Top
 Profile  
 
 Post subject: explode function
PostPosted: Fri Aug 27, 2010 3:04 am 
Offline

Joined: Thu Aug 26, 2010 11:12 am
Posts: 1
Hi guys !


I ve modifed , the data input method in order to have parameters separated with # instead of : .

As well I ve modified the explode function in order to split the parameters with # instead of : .

The reason is that my remote server is defined as tcp:xxx.xxx.xxx.xxx so my hostname was 'exploded' by the script giving error messages as :

CMDPHP: Poller[0] Host[11] DS[67] WARNING: Result from SERVER not valid. Partial Result: FATAL: Too many elements

Now it works perfectly .

SammIO
(Cacti newbie)


Top
 Profile  
 
 Post subject: Re: better ucd/net-snmp memory usage -- update June 21 2009
PostPosted: Thu Nov 24, 2011 10:23 pm 
Offline

Joined: Thu Nov 24, 2011 10:17 pm
Posts: 1
Since install of this template I can't see any data income in RRA and Graphs - only zeros.
After a long investigation I found a problem on my config.
Every host has SNMP timeout 3000 ms. It seams this script has problems with such big timeouts.
So I set it to 2000 ms and data start collecting.


Top
 Profile  
 
 Post subject: Re: better ucd/net-snmp memory usage -- update June 21 2009
PostPosted: Wed Apr 03, 2013 5:53 pm 
Offline

Joined: Tue Oct 17, 2006 10:27 pm
Posts: 15
Hello,

Bit of a late update on this thread.

But I've been watching my poller runtime and notice it exceeds the default 300 seconds quite regularly.

Digging into it further, uncovers the following:

Code:
cacti     6161     1  0 09:00 ?        00:00:00 /usr/bin/php -q /var/www/cacti/cmd.php 354 411
cacti     6196  6161  0 09:00 ?        00:00:00 /usr/bin/php -q /var/www/cacti/script_server.php cmd
cacti    12598     1  0 08:10 ?        00:00:00 /usr/bin/php -q /var/www/cacti/cmd.php 489 503
cacti    12628 12598  0 08:10 ?        00:00:00 /usr/bin/php -q /var/www/cacti/script_server.php cmd
cacti    16725     1  0 09:20 ?        00:00:00 /usr/bin/php -q /var/www/cacti/cmd.php 159 265
cacti    16754 16725  0 09:20 ?        00:00:00 /usr/bin/php -q /var/www/cacti/script_server.php cmd
cacti    23084     1  0 08:30 ?        00:00:00 /usr/bin/php -q /var/www/cacti/cmd.php 123 157
cacti    23115 23084  0 08:30 ?        00:00:00 /usr/bin/php -q /var/www/cacti/script_server.php cmd


And the only script/server script I have running is this memory graph.

Anyway, I hope I've interpreted things correctly.

Has anyone else had this experience?


Top
 Profile  
 
 Post subject: Re: better ucd/net-snmp memory usage -- update June 21 2009
PostPosted: Sun Sep 10, 2017 10:53 am 
Offline

Joined: Sun Sep 10, 2017 10:26 am
Posts: 1
Hi!

I am having problems getting this template to work with cacti 1.1.21.

Here is the error that poller gets:
SCRIPT: /var/www/html/cacti-1.1.21/scripts/ss_netsnmp_memory.php ss_netsnmp_memory '192.168.0.10':'2':'public':'':'':::::'161':'500', output: FATAL: No SNMP parameter bundle provided
Syntax: ss_netsnmp_memory.php <hostname>:<snmp_version>:[<snmp_community>]:\
[<snmp3_username>]:[<snmp3_password>]:[<snmp3_auth_protocol>]:[<snmp3_priv_password>]:\
[<snmp3_priv_protocol>]:[<snmp32017-09-10 18:44:32 - SPINE: Poller[1] Device[9] TH[1] DS[237] SS[0] SERVER: /var/www/html/cacti-1.1.21/scripts/ss_netsnmp_memory.php ss_netsnmp_memory '192.168.0.10':'2':'public':'':'':::::'161':'500', output: U

It seems that there are quotes added to the data input method. I also red from here that this could be sql injection protection. I am using mariadb 10.1.
https://forums.cacti.net/viewtopic.php?f=2&t=57577

To get it work I can modify directly inside database the poller_item but would be great to get it done automatically.

Has anyone got it working with newer cacti/mariadb?


Rene


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 71 posts ]  Go to page Previous  1, 2, 3, 4, 5

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 5 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