Plugin that checks filesystem

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
srikanth.kallu
Posts: 243
Joined: Thu Jul 26, 2012 10:48 am

Plugin that checks filesystem

Post by srikanth.kallu »

Hi,

I think we have a bug in the script that checks the file system.

I have added a new NFS shared file system to one of my host It is monitoring it which looks good so far.

I was testing it my unmounting that File system. But it still shows that servce for that file system is up and running.

So got confused about this and just created a directory and added it to my monitoring list. I stil can monitor it i was thiniking we monitor only filesystems not thed directories. ?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Plugin that checks filesystem

Post by slansing »

We need to know what plugin you are using.
srikanth.kallu
Posts: 243
Joined: Thu Jul 26, 2012 10:48 am

Re: Plugin that checks filesystem

Post by srikanth.kallu »

It is the default one. I have attached a screenshot of my settings.
You do not have the required permissions to view the files attached to this post.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Plugin that checks filesystem

Post by slansing »

There are some good examples, as well as the usage text for the check_disk plugin here:

https://www.nagios-plugins.org/doc/man/check_disk.html

I'd recommend structuring the check based off of that.
srikanth.kallu
Posts: 243
Joined: Thu Jul 26, 2012 10:48 am

Re: Plugin that checks filesystem

Post by srikanth.kallu »

I think i havent explained my issue correctly

[root@b4sl03 libexec]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LVroot
3.9G 959M 2.8G 26% /
/dev/mapper/VolGroup00-LVusr
3.9G 2.0G 1.7G 55% /usr
/dev/mapper/VolGroup00-LVvar
3.9G 337M 3.4G 9% /var
/dev/mapper/VolGroup00-LVhome
3.9G 1002M 2.7G 27% /home
/dev/mapper/VolGroup00-LVtmp
2.0G 82M 1.8G 5% /tmp
/dev/sda3 99M 27M 68M 28% /boot
tmpfs 48G 0 48G 0% /dev/shm
/dev/mapper/VolGroup00-LVapps
102G 33G 65G 34% /apps
txforge01:/apps/endeca/mouser
217G 161G 45G 79% /forge


[root@b4sl03 libexec]# mkdir /srikanth
[root@b4sl03 libexec]# ./check_disk -w 10% -c 5% -p /srikanth
DISK OK - free space: / 2804 MB (74% inode=98%);| /=958MB;3570;3768;0;3967

Why is it showing usage of the folder /srikanth. I havent mounted it. I think it is assuming as / ?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Plugin that checks filesystem

Post by tmcdonald »

Correct, it is showing you the usage of the root partition. In your df -h output it shows 26% used, and in your check output it shows 74% free, and since this adds up to 100 we can assume that's what is happening. The reason it does not work as you expect is because check_dick does not check a directory for free space (there really isn't such a thing). If you use /srikanth as a mountpoint for a network drive or a local drive, then it will work.
Former Nagios employee
srikanth.kallu
Posts: 243
Joined: Thu Jul 26, 2012 10:48 am

Re: Plugin that checks filesystem

Post by srikanth.kallu »

Ok let me ask it this way.

I have a NFS shared filesystem (/forge). I want to get alert if it gets unmounted or if it inaccessable or anyother NFS stale errors.

How do i do this ?

Please help.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Plugin that checks filesystem

Post by tmcdonald »

Have you tried searching for "NFS" on Nagios Exchange? For example, the check_nfs_stale plugin.
Former Nagios employee
srikanth.kallu
Posts: 243
Joined: Thu Jul 26, 2012 10:48 am

Re: Plugin that checks filesystem

Post by srikanth.kallu »

I have wrote a simple plugin which suits my environment

#!/bin/sh

FILE=/tmp/nfs.txt

df -h | grep mnt > $FILE

if [ -s $FILE ]
then
echo "/mnt is OK"
stateid=0
else
echo "/mnt is missing "
stateid=2
fi
exit $stateid


I have defined this in CCM-->service--> addnew and followed the rest of the procedure.

When i click on test command it works but that serive is not showing in home-->service detail of that paricular host.

What am i missing ? please help.
You do not have the required permissions to view the files attached to this post.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Plugin that checks filesystem

Post by sreinhardt »

Have you applied configuration? Is this service enabled?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked