LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Snmp disk monitoring help needed (https://www.linuxquestions.org/questions/linux-newbie-8/snmp-disk-monitoring-help-needed-617671/)

investmentbnker75 01-31-2008 08:53 AM

Snmp disk monitoring help needed
 
Im monitoring disk partitions using Nagios and the plug in check_disk. It returns too much information in the sense that it gives inode information. see below:

DISK OK - free space: / 4 GB (94% inode=98%)

I want to show only this:

DISK OK - free space: / 4 GB 94%

Im assuming this is configured in snmp.conf which is where i set up what partitions i wanted monitored with this below:

disk /
disk /boot
disk /boot2
disk /home
disk /local
disk /opt
disk /tmp
disk /usr
disk /var

Can anyone let me know what direction i should go to resolve this?

Very much appreciated!

unSpawn 01-31-2008 09:19 AM

Quote:

Originally Posted by investmentbnker75 (Post 3041134)
Im assuming this is configured in snmp.conf which is where i set up what partitions i wanted monitored

Nagios can retrieve information through SNMP but SNMP and Nagios are two different things. The check_disk plugin checks the amount of used disk space on a mounted file system and is is referenced in your checkcommands.cfg. If you (s)locate check_disk on disk and give it the --help arg it shows you what and how it can output information. There's no "terse" mode so you could make a wrapper to conform to your specs. Something like:
Code:

#!/bin/sh
# This is /location/of/check_disk.sh
grep -q "^$1" /proc/mounts || { echo "${0}: no device "$1"; exit 1; }
/location/of/check_disk -m "$1" | cut -d ' ' -f 1-9|tr -d '('
exit 0

Replace all "/location/of/" with the path leading to check_disk, then place /location/of/check_disk.sh there and make executable, then change the reference in your checkcommands.cfg to use the script. Note that I didn't test it and so YMMV(VM). Also note you'll lose all statistics and alerting for those partitions.

investmentbnker75 01-31-2008 09:52 AM

Thanks for you quick response unSpawn, i tried what you suggested but it didnt resolve my issue.

After doing some more digging im wondering since my entry in snmpd.conf determies what partitions i want monitored if the entries ive listed below can be altered to change what is outputted when the check_disk is run as check_disk -u GB -l -w 20% -c 10%

BTW, this isnt defined in checkcommands.cfg, it is called by the nrpe.conf file as command[check_disk_all]=/usr/lib64/nagios/plugins/check_disk -u GB -l -w 20% -c 10%

and then nrpe does the check.

Thanks

unSpawn 02-01-2008 05:44 AM

Quote:

Originally Posted by investmentbnker75 (Post 3041185)
this isnt defined in checkcommands.cfg, it is called by the nrpe.conf

AFAIK where it's done doesn't really matter since the same principle applies: make wrapper, change config.

investmentbnker75 02-01-2008 08:50 AM

I think it would be better if someone with experience with SNMP respond. A wrapper is a work around and im looking to resolve the issue directly. Thank you anyways.

unSpawn 02-01-2008 10:02 AM

Quote:

Originally Posted by investmentbnker75 (Post 3042437)
I think it would be better if someone with experience with SNMP respond.

I think you pushed the wrong button there, but OK. While we both wait for a fellow LQ member with major SNMP-fu to show up, let's in the meanwhile assert you know your way around Nagios, NRPE and SNMP, and I don't, so answering these should be real easy for you then:
- When using Nagios to poll a local or remote disk for resource information, what plugin would you regularly use?
- When using Nagios to poll a local or remote SNMP daemon for resource information, what plugin would you regularly use?
- When configuring a SNMP daemon for presenting disk resource information, using the standard UCD MIB, what default OID is presented in snmpd.conf?
- Using snmpwalk what would the commandline look like to query that OID?
- Using Nagios' check_snmp to query that same OID, what would the commandline look like?
- What is the difference in output between using snmpget and check_snmp?
- What is the difference in output between using check_disk on a mounted disk and using check_snmp on that OID?
- What is the difference in output between using check_disk and using check_disk with NRPE?
- Which above used Nagios plugin showed percentage signs and which one didn't?

investmentbnker75 02-01-2008 07:56 PM

Ok i figured it out. The response you were giving were way off base on the original question i asked which was how to alter the output the Nagios plugin was reporting. While i appreciate your attempt at assisting me on this, i think a better understanding of how Nagios functions and how they interact with plugins would have generated an appropriate solution.

Nagios plugins are either binaries, perl scripts or shell scripts. If the plugin is a script then altering the script would have been a solution. Since snmp is running, reading the script and understanding how it interacts with the snmp.conf file is necessary.

Adding a band aid on top of an issue means theres one more thing that has to be called or maintained, in this situation only. I use wrappers for other things but this isnt the solution here.

I resolved my issue and it was through a better understanding of snmp and how it uses OID's and how scripts return output.

unSpawn 02-01-2008 09:22 PM

Quote:

Originally Posted by investmentbnker75 (Post 3043114)
I resolved my issue and it was through a better understanding of snmp and how it uses OID's and how scripts return output.

Well, then please enlighten me and post the steps necessary to change it.

investmentbnker75 02-02-2008 10:37 PM

Ill let you use the ridiculous steps you tried to get me to use or find the REAL answer the way i did. Let me know which works better for you.

unSpawn 02-03-2008 05:02 AM

Quote:

Originally Posted by investmentbnker75 (Post 3044193)
Ill let you use the ridiculous steps you tried to get me to use or find the REAL answer the way i did.

Thanks. That really confirms your level of professionality, maturity and skill, and your understanding of how communities and reciprosity work.

investmentbnker75 02-18-2008 08:51 AM

And you confirmed you have no idea what youre talking about, even though you try to sound like you do and shouldnt post to anyones request unless you have a clue. You waste peoples time with your un helpful responses.

unSpawn 02-19-2008 07:15 AM

Heh, you're funny.


All times are GMT -5. The time now is 02:22 AM.