seem to have lost nagios.cmd
Stanley Hopcroft
Stanley.Hopcroft at IPAustralia.Gov.AU
Thu May 8 00:44:07 CEST 2003
Dear Madam,
I am writing to thank you for your letter and say,
On Wed, May 07, 2003 at 03:16:13PM -0500, Irene Sakellarakis wrote:
> At some point during my fumblin configurations today, I appear to have
> lost the ../var/rw/nagios.cmd file. Everything worked just fine until I
> started making some changes to cgi.cfg and nagios.cfg. I enabled and
> disabled some commands, but I didn't expect that any changes in those
> files would cause the command file to go away.
That I would not expect the 'named pipe' to go away after configuration
changes. However, I don't really know whether it has been vanishing and
reappearing (electron like) while I have been looking elsewhere.
This extract from base/utils.c appears relevant
utils.c-
utils.c- /* create the external command file as a named pipe
(FIFO) */
utils.c: if((result=mkfifo(command_file,S_IRUSR | S_IWUSR |
S_IRGRP | S_IWGRP))!=0){
utils.c-
utils.c- snprintf(buffer,sizeof(buffer)-1,"Error: Could
not create external command file '%s' as named pipe: (%d) -> %s. If
this file already exists and you are sure that another copy of Nagios is
not running, you should delete this
file.\n",command_file,errno,strerror(errno));
utils.c- buffer[sizeof(buffer)-1]='\x0';
utils.c-
write_to_logs_and_console(buffer,NSLOG_RUNTIME_ERROR,TRUE);
tsitc>
So, it looks like
1 Nag creates the fifo for you
2 If it is already there, Nag cannot create the fifo until you delete
it.
eg
tsitc# cd /usr/local/nagios/var/
tsitc# cd rw/
tsitc# ll nagios.cmd
prw-rw---- 1 nagios nagiocmd 0 May 7 20:16 nagios.cmd
tsitc# ps -auxw | grep nagios | head -2
nagios 51997 0.0 4.4 18628 11412 ?? Ss Tue11PM 11:08.97
/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
anwsmh 49283 0.0 0.2 900 404 p0 I+ 8:21AM 0:00.00 tail -f
nagios.log
tsitc# killall nagios
tsitc# ll
# It's gone.
tsitc# /usr/local/etc/rc.d/nagios.sh start
tsitc#
# Its' back
tsitc# ll
total 0
prw-rw---- 1 nagios nagiocmd 0 May 8 08:41 nagios.cmd
tsitc#
> Can I recreate this? What am I missing?
>
> Thanks in advance,
> Irene
If the file is not there after restarting Nag, you have a cofig problem
because Nag refuses to start.
Suggest <path_to_nag>/nagios -v <path_to_nag>/etc/nagios.cfg
Yours sincerely.
--
------------------------------------------------------------------------
Stanley Hopcroft
------------------------------------------------------------------------
'...No man is an island, entire of itself; every man is a piece of the
continent, a part of the main. If a clod be washed away by the sea,
Europe is the less, as well as if a promontory were, as well as if a
manor of thy friend's or of thine own were. Any man's death diminishes
me, because I am involved in mankind; and therefore never send to know
for whom the bell tolls; it tolls for thee...'
from Meditation 17, J Donne.
-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list