I have a problem woth the Nagios.cmd file.
i am using nagios latest release en ubuntu latest release.
i have created the nagios.cmd with the following procedure
cd /usr/local/nagios/var/rw
touch nagios.cmd
chown nagios.www-data nagios.cmd
chmod 660 nagios.cmd
how can i resolve the issue that after every restart of the nagios server the file disapeares.
it only happend after a compleet restart of the servers.
cheers
Nagios.cmd is disapearing aftter restart nagios server
Re: Nagios.cmd is disapearing aftter restart nagios server
Nagios should be recreating that file every time it's restarted. Are you sure that Nagios has permission to write to that directory?
Re: Nagios.cmd is disapearing aftter restart nagios server
It seems Ok with the rights
When i recreate the file and stop en start nagios it works fine
It only occours when i restart the comPleet server
Is it a timing issua?
What should the rights be on the /usr/local/nagios/var/rw be ?
I am not a linux gooro so any help is welcome
Thx
When i recreate the file and stop en start nagios it works fine
It only occours when i restart the comPleet server
Is it a timing issua?
What should the rights be on the /usr/local/nagios/var/rw be ?
I am not a linux gooro so any help is welcome
Thx
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios.cmd is disapearing aftter restart nagios server
pjonkers wrote:What should the rights be on the /usr/local/nagios/var/rw be ?
Code: Select all
# ls -ld /usr/local/nagios/var/rw
drwxrwsr-x 2 nagios nagcmd 4096 Apr 17 09:00 /usr/local/nagios/var/rwRe: Nagios.cmd is disapearing aftter restart nagios server
I changed the rights for the RW folder as you specified and stil no luck.
but after teh reboot of the server.., i stopped nagios with /etc/init.d/nagios stop en started again with /etc/init.d/nagios start.
now the file is created.
is there a way to delay the nagios start command or do it twice ?
Peter
but after teh reboot of the server.., i stopped nagios with /etc/init.d/nagios stop en started again with /etc/init.d/nagios start.
now the file is created.
is there a way to delay the nagios start command or do it twice ?
Peter
Re: Nagios.cmd is disapearing aftter restart nagios server
You could add 'service nagios restart' to /etc/rc.local to start nagios twice when booting.
-
wormfishin
- Posts: 31
- Joined: Tue Apr 10, 2012 8:11 am
Re: Nagios.cmd is disapearing aftter restart nagios server
You could call a script on startup:pjonkers wrote:I changed the rights for the RW folder as you specified and stil no luck.
but after teh reboot of the server.., i stopped nagios with /etc/init.d/nagios stop en started again with /etc/init.d/nagios start.
now the file is created.
is there a way to delay the nagios start command or do it twice ?
Peter
Code: Select all
#!/bin/bash
#how many seconds you want to delay for
sleep 300
#start nagios service
/sbin/service nagios startRe: Nagios.cmd is disapearing aftter restart nagios server
That's essentially what happens when you add commands to /etc/rc.local.wormfishin wrote:You could call a script on startup: