How to view all the Mount Points on Linux

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
systemali
Posts: 23
Joined: Tue Feb 02, 2016 5:55 am

Re: How to view all the Mount Points on Linux

Post 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
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: How to view all the Mount Points on Linux

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
systemali
Posts: 23
Joined: Tue Feb 02, 2016 5:55 am

Re: How to view all the Mount Points on Linux

Post 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
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: How to view all the Mount Points on Linux

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
systemali
Posts: 23
Joined: Tue Feb 02, 2016 5:55 am

Re: How to view all the Mount Points on Linux

Post 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.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: How to view all the Mount Points on Linux

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
systemali
Posts: 23
Joined: Tue Feb 02, 2016 5:55 am

Re: How to view all the Mount Points on Linux

Post 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 !!
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: How to view all the Mount Points on Linux

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
systemali
Posts: 23
Joined: Tue Feb 02, 2016 5:55 am

Re: How to view all the Mount Points on Linux

Post 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 :)
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: How to view all the Mount Points on Linux

Post by hsmith »

Eric is quite the gem :). Let us know how it went.
Former Nagios Employee.
me.
Locked