XI and automate downtime via ansible
Posted: Tue Jun 18, 2024 7:08 am
Hello all,
I'm trying to automate downtime using an ansible playbook and I am getting errors. I'm using the nagios user, which has the rights and keys to access the servers, and I can only get it to work on one server which is the nagios server itself. I tried copying in the nagios.cfg file but that doesn't seem to help.
Any ideas?
TASK [Gathering Facts] *********************************************************
ok: [server02]
ok: [server01]
ok: [nagserver]
TASK [Schedule an hour of host downtime] ***************************************
fatal: [server02]: FAILED! => {"changed": false, "cmdfile": "/usr/local/nagios/var/rw/nagios.cmd", "msg": "nagios command file does not exist"}
changed: [nagserver] => {"changed": true, "nagios_commands": ["[1718712031] SCHEDULE_HOST_DOWNTIME;bnagp03vr;1718712031;1718715631;1;0;3600;Ansible;Scheduling downtime"]}
fatal: [server01]: FAILED! => {"changed": false, "msg": "unable to locate nagios.cfg"}
PLAY RECAP *********************************************************************
nagserver : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
server01 : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
server02. : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
I'm trying to automate downtime using an ansible playbook and I am getting errors. I'm using the nagios user, which has the rights and keys to access the servers, and I can only get it to work on one server which is the nagios server itself. I tried copying in the nagios.cfg file but that doesn't seem to help.
Any ideas?
TASK [Gathering Facts] *********************************************************
ok: [server02]
ok: [server01]
ok: [nagserver]
TASK [Schedule an hour of host downtime] ***************************************
fatal: [server02]: FAILED! => {"changed": false, "cmdfile": "/usr/local/nagios/var/rw/nagios.cmd", "msg": "nagios command file does not exist"}
changed: [nagserver] => {"changed": true, "nagios_commands": ["[1718712031] SCHEDULE_HOST_DOWNTIME;bnagp03vr;1718712031;1718715631;1;0;3600;Ansible;Scheduling downtime"]}
fatal: [server01]: FAILED! => {"changed": false, "msg": "unable to locate nagios.cfg"}
PLAY RECAP *********************************************************************
nagserver : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
server01 : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
server02. : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0