Page 1 of 1

Permission Denied to a directory

Posted: Tue Oct 16, 2018 3:16 am
by qoyyuum
Nagios has alerted that it doesn't have access or permission to a backup directory with a custom python_client plugin that my previous sysadmin has developed.

In $ less /var/log/messages

Code: Select all

Oct 16 00:00:00 monitor nagios: CURRENT SERVICE STATE: backup.system.local;PYBACKUP;CRITICAL;HARD;2;"Unknown [Errno 13] Permission denied: /backup/latest
After rescheduling the next check for pybackup, /var/log/messages shows:

Code: Select all

Oct 16 09:57:11 monitor nagios: SERVICE ALERT: backup.system.local;PYBACKUP;WARNING;HARD;2;(null)
We don't understand how or why it suddenly says it has no permissions to it. We also don't know what user was set for this python plugin.

Using Nagios Core 3.4.4

$ backup-py.cfg

Code: Select all

define service {
        service_description     PYBACKUP
        display_name            Python Backup for VMs
        use                     python_client
        host_name               backup.system.local
        }
$ commands.cfg

Code: Select all

define command{
        command_name    check_dummy
        command_line    $USER1$/check_dummy $ARG1$ $ARG2$
        }
I do not know where else to check for more info. I would appreciate any help or pointers I can get to resolve this. Thanks!

Re: Permission Denied to a directory

Posted: Tue Oct 16, 2018 4:30 pm
by ssax
Please post the service definition from /usr/local/nagios/var/objects.cache so that we can see what command it's running.

Re: Permission Denied to a directory

Posted: Tue Oct 16, 2018 4:33 pm
by cdienger
Have you verified all the files their permissions exist in the directory the way the script would expect? What does the drive space look like?

If you're familiar with python you could update the script to log or return more useful information to track down where it is failing - what command did it fail on, which user is it running against, do the files exist, etc..