Icinga permissions

icinga2

(mozes) #1

Hi,

I just started using Icinga2 for monitoring and had a permission issue with scripts that execute commands.

For example, I created a simple alert which the plugin script create a file with some records. But I get a permission denied for the line “echo new record $DATE >> log.test”. The script have the required permissions.

Do I need to configure Icinga permission somewhere? this is some security restriction of Icinga?

Thank you in advance,


(Nicolai) #2

Is the directory you’re writing to writable for the icinga / nagios user (depending on your distribution)?


#3

Please note that the monitoring process has a “reduced” environment compared to a logged-in user so it is advisable to use absolute paths to be sure that the files are created at the desired locations.


(mozes) #4

Thank for your answers.

  1. I checked and directory have all permissions: @nicolaiB

    [root@localhost tmp]# getfacl /tmp/
    getfacl: Removing leading ‘/’ from absolute path names

    file: tmp/

    owner: root

    group: root

    flags: --t

    user::rwx
    group::rwx
    other::rwx

  2. I include all the path as you advice: @Wolfgang

/tmp/logs.test