Page 2 of 5

Re: How to view all the Mount Points on Linux

Posted: Mon Mar 07, 2016 1:01 am
by systemali
This infact looks more promising :-

http://sites.box293.com/nagios/guides/n ... t-from-rpm

Can anybody share their experiences with them ?

thank you

Re: How to view all the Mount Points on Linux

Posted: Mon Mar 07, 2016 1:03 am
by Box293
Yes I did play with them a bit:

http://sites.box293.com/nagios/guides/n ... t-from-rpm
http://sites.box293.com/nagios/guides/n ... t-from-rpm
http://sites.box293.com/nagios/guides/n ... rom-github

My thoughts were that it is still a bit basic in terms of the available modules, you can most likely configure it to run external scripts/plugins, but then you are really just doing the same thing as the NRPE client.

I think it's going to be better in the future, just not right now.

Re: How to view all the Mount Points on Linux

Posted: Mon Mar 07, 2016 1:12 am
by systemali
Thank you Box293 for your prompt revert !

I guess i will continue my search for an easy way out to configure SNMP to map all the partitions of the host computer under Nagios !!

Until then, if anybody can add to this thread, it will be appreciable

Thank you

Re: How to view all the Mount Points on Linux

Posted: Mon Mar 07, 2016 9:08 am
by eloyd
Am I missing something? This isn't very hard to do. Make your service check look like this:

Code: Select all

define service {
  .
  .
  check_command check_by_ssh!check_disk -w 10% -c 5% -p / -p /usr -p /var -p /whatever -p /mountpoint_goes_here
  .
You can specify multiple mount points on the check_disk command, and if any one of them violates the warning or critical thresholds, then the entire check will return that result.

I question the meaningfulness of this approach, however. If / is getting full, that has an entirely different level (or maybe even warning/critical thresholds) than if /var is getting full. That's my opinion.

Looking for something more automated? Try this for the basis of a plugin:

Code: Select all

#!/bin/sh
for mountPoint in `df -P | grep "%" | awk '{print $NF}'`; do
  /usr/local/nagios/libexec/check_disk -w WARNING -c CRITICAL -p $mountPoint
  # Capture and track output and return code
done
# Process output and return code and spit the results back to Nagios
Add maybe six lines and you have yourself an automatic mount point checker for Linux.

Re: How to view all the Mount Points on Linux

Posted: Mon Mar 07, 2016 11:04 am
by systemali
Hey Eric,

Appreciate your inputs.

Would you mind telling me, can i define the service in my SNMP.conf ?

If yes, Then, do i just copy and paste your statement ?

My sincere apologies i am bugging you with lame questions, But since this is my first time with Nagios i am very nervous and excited too :(

Thank you once again for all your inputs.

Re: How to view all the Mount Points on Linux

Posted: Mon Mar 07, 2016 11:18 am
by eloyd
I think this is the first time you mentioned SNMP. That changes things. A good start would be to look at http://blog.danmassey.net/?p=908 to get an idea of what you need, but you will need to either parse a lot of SNMP output, or you will need separate checks for each disk.

Re: How to view all the Mount Points on Linux

Posted: Mon Mar 07, 2016 11:47 am
by systemali
Hey Eric,

My apologies if i didn't None the less, Thank you once again for the lead to the url that you have provided.

I have SNMP configured on all ny host computers, so now Is this what i need to enter in NAGIOS server configuration :-

/usr/bin/snmpwalk -v 2c -c public <IP of HOST Computer> .1.3.6.1.4.1.2021.9

Do i have to make duplicate entries of the above line and just change the IP address of the host computers ?

Please let me know if i am on the correct path ?

Thank you for your time !!

Re: How to view all the Mount Points on Linux

Posted: Mon Mar 07, 2016 11:59 am
by eloyd
Yes, you are on the correct path!

However, you need to use check_snmp, not snmpwalk. You might want to do some Knowledge Base searches at https://support.nagios.com/kb/category.php?id=14 to see how to implement SNMP based monitoring.

Re: How to view all the Mount Points on Linux

Posted: Mon Mar 07, 2016 12:14 pm
by systemali
Thank you Eric,

You are a gem of a person :)

I shall have this tried out tomorrow in my office and shall revert back with updates !!

Please keep an eye on this thread :)

Re: How to view all the Mount Points on Linux

Posted: Mon Mar 07, 2016 2:06 pm
by hsmith
Eric is quite the gem :). Let us know how it went.