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

How to view all the Mount Points on Linux

Post by systemali »

Hello,

I can see all the basic details of my server under Nagios ( /, Load, Memory, Ping )

But I need to also view all the mount points on the server, how can i see that ?

Any assistance please ?

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 »

Code: Select all

/usr/local/nagios/libexec/check_disk -h
Notice that you can specify multiple mount points:

Code: Select all

./check_disk -w 10% -c 5% -p / -p /boot
However, this will only alert if ANY of them are in a warning/critical state. You may want to simply create a separate service for each file system so you can alert on each on separately.
Last edited by eloyd on Fri Mar 04, 2016 10:59 am, edited 1 time in total.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: How to view all the Mount Points on Linux

Post by rkennedy »

Thanks @eloyd! It should be /usr/local/nagios/libexec/check_disk -h to check the help menu.

@systemali - let us know if you have any further questions,
Former Nagios Employee
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 »

Edited. Thanks for the catch.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
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 »

Thanks Eric :)
Former Nagios Employee.
me.
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 Eloyd and the gang,

Thank you all for your valuable inputs and enlightening me on this.

Yes, i am aware of this "/usr/local/nagios/libexec/check_disk -h" and its help functions,

But as Eloyd mentioned, I will have to create separate service for each file system, Can somebody
please explain me, how do i go about doing that ?

Coz i need to monitor all my servers and their partitions whether critical or not !!

Thank you all once again :)

Cheers !
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 »

If this is not something you are comfortable doing or have the knowledge to do, then you will have a tough time managing a Nagios installation. While Nagios is simple in its approach, it can be quite complex to manage and maintain a large installation. You need the basic skills of adding and removing hosts and service checks, and you should be comfortable moving around within the Nagios configuration files. Some basic information is available at https://assets.nagios.com/downloads/nag ... n/toc.html. I recommend you start with the section titled "Configuring Nagios."

In addition to that basic knowledge, assuming you need to monitor this information on remote hosts, you will need to be familiar with SSH, NRPE, or some other agent/wrapper to be able to execute the checks on the remote host and have the results appear within Nagios. There are a number of way to do this, and you should start with the "Monitoring Linux hosts" on the URL that I sent you above.

Having said that, here are two approaches that might help you in the right direction:

Simplest way: Log in to your Nagios server, navigate to the directory that contains your current configuration, and then duplicate the service block that is in the services.cfg file and change the host and mount point for each new section you add to point to the appropriate server and mount point.

Better way: Same as above, but assign the service(s) to a hostgroup and then assign the hostgroup to the machine(s) that needs to be monitored.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
User avatar
nozlaf
Posts: 172
Joined: Sun Nov 09, 2014 9:50 pm
Location: Victoria, Australia

Re: How to view all the Mount Points on Linux

Post by nozlaf »

is there honestly no plugin to monitor a linux host that works the same way as the command on nsclient++?
because with nsclient++ you can just set it to check all disks and it reports

Code: Select all

OK: All drives within bounds"
and the performance data reports back all the disks

Code: Select all

C:\ %'=30%;10;5 'C:\'=70.73G;9.9;4.99;0;99 'D:\ %'=19%;10;5 'D:\'=24.3G;3;1;0;29.99
I don't monitor many linux hosts and I generally setup mine the same every time and use pynag to replicate it automatically so its not hard for me but seems like if someone did write a plugin that worked this way they would be somewhat of a legend
Looking forward to seeing you all at #NagiosCon2019?
-Dedicated Lover of Nconf,PNP4Nagios and Nagvis
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 »

I'm waiting for the lunix version NSClient++ to include a disk checking module, currently that module is only for Windows.
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 »

Hello Everyone,

In my quest for an nsclient++ variant for linux, i came across these 2 links, which sound like they have achieved what we are all looking
for, but i am still doubtful and skeptical.

https://nsclient.org/download/

https://www.nsclient.org/blog/2014/12/0 ... entos-7-0/

Wanted to know if aybody has ever tired them and what was the outcome !!!

Can anybody share their views about it ?

Thank you
Locked