nagios list of process IDs must follow -p

REMY Julien julien.remy at ohs.asso.fr
Fri Jun 23 11:36:58 CEST 2006


In /etc/init.d/nagios : 

status_nagios ()
{

	if test ! -f $NagiosRunFile; then
		echo "No lock file found in $NagiosRunFile"
		return 1
	fi

	NagiosPID=`head -n 1 $NagiosRunFile`
	if test -x $NagiosCGI/daemonchk.cgi; then
		if $NagiosCGI/daemonchk.cgi -l $NagiosRunFile; then
		        return 0
		else
			return 1
		fi
	else
		if ps -p $NagiosPID; then
		        return 0
		else
			return 1
		fi
	fi

	return 1
}

-----Message d'origine-----
De : nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-bounces at lists.sourceforge.net] De la part de Thomas Sluyter
Envoyé : vendredi 23 juin 2006 11:11
À : nagios-users at lists.sourceforge.net
Objet : Re: [Nagios-users] nagios list of process IDs must follow -p

Hey Remy,

> Nagios don't start in my computer (/etc/init.d/nagios start). If I do
> /etc/init.d/nagios status, an error message appears :
>
> ERROR: list of process IDs must follow -p
>
> What wants to say this message?

The script probably contains a call to "ps -p" which requires a  
number of PIDs. My guess is that these PIDs should be generated by  
the script, but that something's going wrong :)

EDIT:
Ah, found it:
>  NagiosPID=`head -n 1 $NagiosRun`
>         if test -x $NagiosCGI/daemonchk.cgi; then
>                 if $NagiosCGI/daemonchk.cgi -l $NagiosRun; then
>                         return 0
>                 else
>                         return 1
>                 fi
>         else
>                 if ps -p $NagiosPID; then
>                         return 0
>                 else
>                         return 1
>                 fi
>         fi

So it's trying to get the PID from the Nagios lock file, but  
apparently there is no PID in there and thus the script borks :)  
Should be easy to fix this, though IMHO this should be fixed in the  
source/package so everyone benefits from it.

Cheers!


Thomas

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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