better ucd/net-snmp memory usage -- update June 21 2009

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

ferrero_sergio
Posts: 27
Joined: Tue Sep 11, 2007 6:33 am

Solved problem

Post by ferrero_sergio »

Already achieve that it was working for the machines Solaris, the problem was in the version of the snmp, because hize the proof of sending the script with the version 1 the snmp and it does not work but with the version 2 perfectly, without nothing problem, this way that I put snmp2 and already it(he,she) was doing(painting).
Thank you very much for everything
super-hornet
Cacti User
Posts: 175
Joined: Sun May 27, 2007 5:42 pm

Post by super-hornet »

I just manage to log in to this forum. Being busy lately.

I will take a look on the script again.

Currently the quick modification may not work with SNMP v3 I think.

SH
Jacek_nykis
Posts: 23
Joined: Fri Jul 20, 2007 10:24 am

Post by Jacek_nykis »

Hi Guys,

I was having problems as well with this script and modified source around line 163 like this:

$snmp_community,
$oid[$cmdoutputcount][1],
$snmp_version,
$snmp_username,
$snmp_password,
"MD5",
"",
"[None]",
"",
$snmp_port,
$snmp_timeout);


Hope this helps.

Regards
Jacek Nykis
fish
Posts: 10
Joined: Tue Nov 09, 2004 12:28 am

Post by fish »

Hi,

i try to export the php script into snmp query xml, but if i change direction to input in the xml script, there's no drop down menu in the Associated Graph Templates, with direction output the drop down menu appears.
also the snmp query only work with direction input.

anyone can help ?
Attachments
with snmp query direction set to input
with snmp query direction set to input
snmp direction input.jpg (25.98 KiB) Viewed 14431 times
with snmp query direction set to output
with snmp query direction set to output
snmp direction output.jpg (38.06 KiB) Viewed 14431 times
redcap
Posts: 18
Joined: Mon Jan 23, 2006 5:49 am

Post by redcap »

Since upgrading to 0.8.7a (Debian package) the grapsh are only using the "used real" stats.
I tried reimporting the latest version of the script, with the modifications to the script described above.
Any clue?
Attachments
graph_image.php.png
graph_image.php.png (41.22 KiB) Viewed 14185 times
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Hi

have you installed this patch : http://cacti.net/download_patches.php ?

"Graph Logic Syntax Issue"
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
redcap
Posts: 18
Joined: Mon Jan 23, 2006 5:49 am

Post by redcap »

Yes I did 2 days ago, as I saw this suggestion already on another post.

The snmpget results seem to be correct:

Code: Select all

/usr/share/cacti/site/scripts# snmpwalk localhost -c  xxxxxx-v1 .1.3.6.1.2.1.25.2.2.0
HOST-RESOURCES-MIB::hrMemorySize.0 = INTEGER: 1003904 KBytes
server:/usr/share/cacti/site/scripts# snmpwalk localhost -c xxxxxx -v1 .1.3.6.1.4.1.2021.4.6.0
UCD-SNMP-MIB::memAvailReal.0 = INTEGER: 25984 kB
server:/usr/share/cacti/site/scripts# snmpwalk localhost -c xxxxxx -v1 .1.3.6.1.4.1.2021.4.6.0
UCD-SNMP-MIB::memAvailReal.0 = INTEGER: 25992 kB
server:/usr/share/cacti/site/scripts# snmpwalk localhost -c xxxxxx -v1 .1.3.6.1.4.1.2021.4.6.0
UCD-SNMP-MIB::memAvailReal.0 = INTEGER: 26004 kB
server:/usr/share/cacti/site/scripts# snmpwalk localhost -c xxxxxx -v1 .1.3.6.1.4.1.2021.4.14.0
UCD-SNMP-MIB::memBuffer.0 = INTEGER: 222244 kB
server:/usr/share/cacti/site/scripts# snmpwalk localhost -c xxxxxx -v1 .1.3.6.1.4.1.2021.4.15.0
UCD-SNMP-MIB::memCached.0 = INTEGER: 479124 kB
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

I've made another graph template set : http://forums.cacti.net/viewtopic.php?t=24501

Image

Image
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
redcap
Posts: 18
Joined: Mon Jan 23, 2006 5:49 am

Post by redcap »

Thanks! This one works great! And without needing a script, nice!
http://forums.cacti.net/viewtopic.php?t=24501 bookmarked ;)
redcap
Posts: 18
Joined: Mon Jan 23, 2006 5:49 am

Post by redcap »

Graphs are messed up since upgrading to 0.8.7b (Debian package) :-(
Attachments
Cacti_1203247861421.png
Cacti_1203247861421.png (239.96 KiB) Viewed 13965 times
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Hi

I've opened bug #1187
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
Findarato
Posts: 29
Joined: Wed Feb 06, 2008 2:56 pm

Post by Findarato »

This issue is with more than just this template, some of my squid graphs are now funky after going to 8.7b
lauriou
Posts: 4
Joined: Wed Apr 25, 2007 5:55 am

Post by lauriou »

Since we updated to cacti 0.8.7.d, the output of the script netsnmp_memory_usage.php have strange behaviour:

With cacti 0.8.7.c:

Code: Select all

/usr/bin/php -q /home/reseau/cacti_old/scripts/netsnmp_memory_usage.php ...
totalReal:16301160 availReal:194896 totalSwap:20479992 availSwap:20479824 memBuffer:18456 memCached:15593124 usedReal:494684 usedSwap:168
With cacti 0.8.7.d:

Code: Select all

/usr/bin/php -q /home/reseau/cacti/scripts/netsnmp_memory_usage.php ...
totalReal:16301160 availReal: 194524 totalSwap: 20479992 availSwap: 20479824 memBuffer: 18504 memCached: 15593124 usedReal:495008 usedSwap:168
--> White space are added to the output after the colon of availReal, totalSwap, availSwap and memBuffer. In the RRD file, those values are NaN ...

Any idea to solve this issue ?.

Thanks
veiks123
Posts: 1
Joined: Thu Feb 26, 2009 4:08 am

Post by veiks123 »

hello, I had exactly the same problem. It seems the new version likes to add white spaces somewhere and because of that the netsnmp_memory_usage.php file returns them too.

actually the fix is pretty simple - just trim them away.

I used php trim function for that :

the new output in netsnmp_memory_usage.php file :

Code: Select all

$output = $output . $oid[$outputcount][0] . ":" . trim($cmdoutput[$outputcount]) . " ";
the old output in netsnmp_memory_usage.php file :

Code: Select all

$output = $output . $oid[$outputcount][0] . ":" . $cmdoutput[$outputcount] . " ";
Voila and it started working again
lauriou
Posts: 4
Joined: Wed Apr 25, 2007 5:55 am

Post by lauriou »

Hello,

You're right, the trim() function is a good solution.

Thanks !
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests