Getting hrMemorySize

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
cyberconte
Posts: 3
Joined: Wed Apr 27, 2005 3:16 pm

Getting hrMemorySize

Post by cyberconte »

I'm trying to get HOST_RESOURCES-MIB::hrMemorySize (.1.3.6.1.2.1.25.2.2.0) from a net-snmp system on a machine with >4G ram (hence, trying to not use memTotalReal)

hrMemorySize returns the memory count in KB, but i've run into the problem that the units are returned with the integer (i.e. "123456 KBytes"), so the cacti log is full of "WARNING: Result from SNMP not valid. Partial Result: 123456 KBytes", and nothing is getting recorded

How can i get cacti working so that it will use the number?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Currently the regex querys are only allowed for input, not output. So, that being the case you'd have to use a perl script to query the host and parse out the kybtes.

you could also try the updated functions.php file from here, which should also remove the extra characters being returned.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Please apply the following patch and you will be happy! Please post your results. It goes in the lib directory.

TheWitness
Attachments
functions.zip
(14.28 KiB) Downloaded 139 times
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
cyberconte
Posts: 3
Joined: Wed Apr 27, 2005 3:16 pm

Post by cyberconte »

That worked! Thanks a ton! :-D
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests