Code Monkey home page Code Monkey logo

nagios-plugin-check_mountpoints's People

Contributors

11chrisadams11 avatar alexs77 avatar amuraru avatar arakmar avatar b0bba avatar bs-github avatar codepete avatar doctor-love avatar dwerder avatar earonesty avatar jazzl0ver avatar kapouik avatar laughing-penguins avatar ldperron avatar mdklapwijk avatar nielslaukens avatar riton avatar rmdir avatar rocco83 avatar romanzenka avatar thelocehiliosan avatar tomas-l avatar tooooots avatar treydock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nagios-plugin-check_mountpoints's Issues

False return

Hi

If I check the script via check_nrpe I get a critical back

check_nrpe -H server1 -c check_mounts
CRITICAL: /data/dir1 doesn't exist on filesystem

but if I run the script locally (@server1) it gives back the correct information

/usr/lib/nagios/plugins/check_mountpoints.sh -a
OK: all mounts were found ( /data/dir1 )

my nrpe.cfg on the checked server1 is
command[check_mounts]=/usr/lib/nagios/plugins/check_mountpoints.sh -a

/data/dir1 is a NFS mountpoint

Any idea why I get this?
Many thanks!!

Check not working with ZFS

Hi,

First, thanks for the code check. I wish that the script work on FreeBSD with ZFS.
The code is actually running on several machines (Linux CentOS (XFS and FreeBSD) without problems.

I've done several changes (bash => sh) and some tweaks to be compliant with zfs (no fstab) and readonly filesystem for zfs send snapshot purpose.

Could you check my changes and tell it's enough clean to integrate it to the main tree of the project ?

I think it could be a good feature added :)

Thanks

Bertrand

check_mountpointsZFS.sh.zip

NFS mount not checked correctly

Hi,

I have a few NFS mounts, on a Centos 6.4 2.6.32-358.el6.x86_64. They are mounted and working, but when executing the check :

$ df -h
Filesystem Size Used Avail Use% Mounted on
[...]
192.168.3.65:/var/sharedServices/web/images 239G 70G 157G 31% /var/sharedServices/web/images``

$ /usr/lib64/nagios/plugins/check_mountpoints.sh -a
CRITICAL: /var/sharedServices/web/images/ is not mounted ;

CIFS not recognised

I'm trying this script on CentOS7.1, and while it's working correctly with one server, but not another. On investigation on the non-working server the CIFS mounts had trailing /'s on both the source and mountpoint. Removing the trailing / fixed the issue - but perhaps the script can catch this and not error?

pluguin not working with opsview

hello i've integred the nagios plaguin on opsview , testing it locally it's working but the pluguin is not working on my Opsview server.

this is the configuration made : -H $HOSTADDRESS$ -c check_mountpoints -a '$MOUNTPOINT$' -C '%NRPE_CERTIFICATES:1%' -k '%NRPE_CERTIFICATES:2%' -r '%NRPE_CERTIFICATES:3%' -y '%NRPE_CIPHERS:1%'

the error i get is :

Status Information | NRPE: Unable to read output
by troubleshooting i got : Caught exception in Opsview: :Web::Controller::REST::TestServiceCheck->do_testservicecheck "Unhandled macros"

Any ideas ?

Thanks

ZFS: if zpool.listsnapshots=on the script needs very long

I have a lot of snapshots (every 15 min) and always enable listsnapshots.
This script needs very long for testing all snapshots and meanwhile a lot of snapshots expire:

The fix is:

-         for DS in $(zfs list -H -o name); do
+        for DS in $(zfs list -H -o name -t filesystem); do

delete .mount_test_from

Hello,

where should I insert a delete so it doesn't screw up the script.
I monitor a bunch of windows-shares and the amount of .mount_test_files is huge.

Thank you

False return #2

Hello, I have same problem like here: #41
when runnig locally as nrpe user:

su nrpe
[nrpe@srv]
/ # /usr/lib64/nagios/plugins/check_mountpoints.sh -a
OK: all mounts were found ( /boot /fbdata /home /tmp /usr /var /mnt/backup )

/mnt/backup is fully accessible for nrpe user, tested and works!

even this work when root:

[root@srv]
/ # sudo -u nrpe /usr/lib64/nagios/plugins/check_mountpoints.sh -a
OK: all mounts were found ( /boot /fbdata /home /tmp /usr /var /mnt/backup )

but, when I call with nrpe:

[root@srv]
/ # /usr/lib64/nagios/plugins/check_nrpe -H 127.0.0.1 -c check_mntpoints
CRITICAL: /mnt/backup doesn't exist on filesystem ;
and
[nrpe@srv]
/ # /usr/lib64/nagios/plugins/check_nrpe -H 127.0.0.1 -c check_mntpoints
CRITICAL: /mnt/backup doesn't exist on filesystem ;

ps | grep nrpe

nrpe 10551 0.0 0.0 41492 1480 ? Ss 10:47 0:00 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d

nrpe.cfg:

log_facility=daemon
nrpe_user=nrpe
nrpe_group=nrpe
command[check_mntpoints]=sudo /usr/lib64/nagios/plugins/check_mountpoints.sh -a

/mnt/backup is nfs mountpoint
ls -la /mnt/

drwxr-xr-x. 3 root root 4096 Nov 22 2016 .
drwxr-xr-x. 23 root root 4096 Sep 15 11:04 ..
drwxr-xr-x. 20 root root 4096 Oct 25 09:40 backup

/etc/fstab

192.168.101.130:/backup /mnt/backup nfs auto 0 0

Any idea?
Thanx for help
VicC

\040 in mount points not handled

According to the fstab man page, spaces in target mount point directories should be replaced with \040. This isn't correctly handled and generates an error saying that the directory doesn't exist. I was hoping a simple ${MP/\\040/ } replacement at the top of the MPS for loop would fix it but just causes issues elsewhere.

Script does not work on Solaris 11

What is wrong here?! :-O

root@nfsclnt ~ # grep -i nfsserver /etc/vfstab
nfsserver:/mnt - /mnt nfs - yes rw,xattr

root@nfsclnt ~ # grep -i nfsserver /etc/mnttab
nfsserver:/mnt /mnt nfs rw,xattr,dev=9300001 1507803587

root@nfsclnt ~ # ./check_mountpoints.sh /mnt
CRITICAL: /mnt is not mounted ;

Strange behavior running remotely

Hi,
I've been using this to great success for some time, via nrpe. However, I recently deployed this check to a newly built server, and am getting strange results irrespective as to how it's configured/run.

Basically, if I run the check locally on the server I get:

[root@hostname123 ~]# su - nrpe -s /bin/bash -bash-4.1$ /usr/lib64/nagios/plugins/check_mountpoints.sh -m /etc/mtab -f /etc/fstab -N 3 -M 2 -T 3 -i -w /data/mysql/backups OK: all mounts were found ( /data/mysql/backups) -bash-4.1$ /usr/lib64/nagios/plugins/check_mountpoints.sh -m /etc/mtab -A -wOK: all mounts were found (/data/mysql/backups ) -bash-4.1$ /usr/lib64/nagios/plugins/check_mountpoints.sh -m /etc/mtab -a -w OK: all mounts were found (/data/mysql/backups )

However, whenever I run this from my nagios server (just for this one host: It works just fine on every other box I'm checking) I get the following:

[nagios@nagios_server ~]$ /usr/local/nagios/libexec/check_nrpe -H hostname123 -c check_nfs_mounts CRITICAL: /data/mysql/backups don't exists in filesystem ;

That path most certainly exists, and all other nrpe checks are working just fine.

Any help is greatly appreciated.

Thanks.

Doesn't read mountpoints correctly on CentOS 7

Hello I've got a problem with autodetection from fstab.

Version 2.0 have found only
/
/backup
/replica

But my actual mountpoints in fstab are:
/ = ext4
/boot = ext2
/backup = ext4
/replica = ext4

so I've tried adding /boot mount manually and it said that /boot is not in /etc/fstab and is not mounted at all
So I've updated to the newest version and result of my command with autodetection is:

/usr/lib64/nagios/plugins/check_mountpoints.sh -a
OK: all mounts were found ( /backup /replica )

But when I manually added / /boot /backup and /replica:

/usr/lib64/nagios/plugins/check_mountpoints.sh / /boot /backup /replica
OK: all mounts were found ( / /boot /backup /replica)

Is there any solution to this? :) I've tried also the -f option with no results

Regards,
vasiliev

Actived -a and -w options when any mountpoints in /etc/fstab is in RO

Hello

Nice plugin but i have an issue.

I use -a option to check all mountpoints and -w to write file but manytimes machines are ro mountpoints and touch don't work, its normal.

I suggest you to insert a condition in line 266, but i think my code is not the better way to exclude RO mountpoints for this test.

            elif [ ${WRITETEST} -eq 1 ] && egrep -q "${MP}.*rw" ${FSTAB}; then
            ## if wanted an RW, check if it is writable
                    TOUCHFILE=${MP}/.mount_test_from_$(hostname)
                    touch ${TOUCHFILE} &>/dev/null
                    if [ $? -ne 0 ]; then
                            log "CRIT: ${TOUCHFILE} is not writable."
                            ERR_MESG[${#ERR_MESG[*]}]="${TOUCHFILE} is not writable."
                    else
                            rm ${TOUCHFILE} &>/dev/null
                    fi

line 368 -eq: unary operator expected

I've got obviously the case that the variable ISFW gets no value, thus "",
having this line 368 the if cannot be interpreted correctly.
In line 351 I set the value to 0 which helped.

which: no logger in ((null))

Every now and then, we get this output:

which: no logger in ((null))

It's erratic, and cannot be reproduced manually. Any idea what might cause this?

issue of redirect in stale mountpoints ?

Hello

No really an issue, here is a request for improvement. ^^

In this script, how can I prevent the display of the first two lines? I think it would be better without these two lines.

when i redirect stderr, all is good but i need this directly in script.

what do you think about it ?

Thanks
.
nagios@mycomputer:/home/nagios$ perl check_mountpoints -a
check_mountpoints: line 88: 21397 Terminated df -k ${MP} &>/dev/null
check_mountpoints: line 280: 21406 Terminated df -k ${MP} &>/dev/null
CRITICAL: /srv/spam/toto did not respond in 3 sec. Seems to be stale. ; /srv/spam/titi did not respond in 3 sec. Seems to be stale. ;

nagios@mycomputer:/home/nagios$ perl check_mountpoints -a 2>/dev/null
CRITICAL: /srv/spam/pushit/NotiftoSend did not respond in 3 sec. Seems to be stale. ; /srv/spam/pushit/feedbacks did not respond in 3 sec. Seems to be stale. ;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.