Permission Denied to a directory

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.
Locked
qoyyuum
Posts: 1
Joined: Tue Oct 16, 2018 2:46 am

Permission Denied to a directory

Post 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!
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Permission Denied to a directory

Post by ssax »

Please post the service definition from /usr/local/nagios/var/objects.cache so that we can see what command it's running.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Permission Denied to a directory

Post 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..
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked