LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-31-2008, 08:53 AM   #1
investmentbnker75
Member
 
Registered: Oct 2007
Location: Eastern Seaboard
Distribution: CentOS
Posts: 162

Rep: Reputation: 15
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!
 
Old 01-31-2008, 09:19 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,353
Blog Entries: 55

Rep: Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541
Quote:
Originally Posted by investmentbnker75 View Post
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.
 
Old 01-31-2008, 09:52 AM   #3
investmentbnker75
Member
 
Registered: Oct 2007
Location: Eastern Seaboard
Distribution: CentOS
Posts: 162

Original Poster
Rep: Reputation: 15
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
 
Old 02-01-2008, 05:44 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,353
Blog Entries: 55

Rep: Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541
Quote:
Originally Posted by investmentbnker75 View Post
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.
 
Old 02-01-2008, 08:50 AM   #5
investmentbnker75
Member
 
Registered: Oct 2007
Location: Eastern Seaboard
Distribution: CentOS
Posts: 162

Original Poster
Rep: Reputation: 15
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.
 
Old 02-01-2008, 10:02 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,353
Blog Entries: 55

Rep: Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541
Quote:
Originally Posted by investmentbnker75 View Post
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?
 
Old 02-01-2008, 07:56 PM   #7
investmentbnker75
Member
 
Registered: Oct 2007
Location: Eastern Seaboard
Distribution: CentOS
Posts: 162

Original Poster
Rep: Reputation: 15
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.
 
Old 02-01-2008, 09:22 PM   #8
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,353
Blog Entries: 55

Rep: Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541
Quote:
Originally Posted by investmentbnker75 View Post
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.
 
Old 02-02-2008, 10:37 PM   #9
investmentbnker75
Member
 
Registered: Oct 2007
Location: Eastern Seaboard
Distribution: CentOS
Posts: 162

Original Poster
Rep: Reputation: 15
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.
 
Old 02-03-2008, 05:02 AM   #10
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,353
Blog Entries: 55

Rep: Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541
Quote:
Originally Posted by investmentbnker75 View Post
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.

Last edited by unSpawn; 02-03-2008 at 05:05 AM.
 
Old 02-18-2008, 08:51 AM   #11
investmentbnker75
Member
 
Registered: Oct 2007
Location: Eastern Seaboard
Distribution: CentOS
Posts: 162

Original Poster
Rep: Reputation: 15
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.
 
Old 02-19-2008, 07:15 AM   #12
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,353
Blog Entries: 55

Rep: Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541
Heh, you're funny.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SNMP master & SNMP client Script for system monitoring ratul_11 Programming 1 12-24-2007 05:32 AM
Security monitoring using SNMP nautilus Linux - Security 1 06-21-2007 01:06 PM
snmp monitoring scot.russell Linux - Networking 1 03-17-2006 07:20 AM
SNMP & monitoring? jabrealj Linux - Software 0 12-20-2004 02:05 PM
SNMP Monitoring markma Linux - General 1 01-02-2001 11:46 AM


All times are GMT -5. The time now is 07:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration