[Nagios-users] No notifications while restarting any services on remote host

2009-04-14 Thread Kaushal Shriyan
Hi,

When i restart any services on the remote client For example tomcat
application server running on port 8080. I dont get any notifications or
alerts. Just want to understand the technique is it because of the
normal_check_interval  5 configured in services.cfg and interval_length=60
defined in nagios.cfg.

Please explain.

Thanks and Regards

Kaushal
--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com___
Nagios-users mailing list
Nagios-users@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

Re: [Nagios-users] No notifications while restarting any services on remote host

2009-04-14 Thread Roy Sigurd Karlsbakk
On 14. april. 2009, at 08.33, Kaushal Shriyan wrote:

 Hi,

 When i restart any services on the remote client For example tomcat  
 application server running on port 8080. I dont get any  
 notifications or alerts. Just want to understand the technique is it  
 because of the normal_check_interval  5 configured in services.cfg  
 and interval_length=60 defined in nagios.cfg.


When you restart something like a tomcat server, it takes to short a  
time for Nagios to notice. If you want a notice when something is  
restarted, write a script that checks the root PID of the process and  
make this generate an email. I don't Nagios is very well suited for  
this operation, but a small script written in your favourite  
language can do it without much problems. Example:

---
$ cat pidcheck.sh
#!/bin/sh

PIDDIR=/var/pidcheck
PIDFILE=$PIDDIR/$1

[ -d $PIDDIR ] || mkdir -p $PIDDIR

thispid=`pidof apache2 | cut -d  -f1`

if [ ! -f $PIDFILE ]
then
echo -n $thispid  $PIDFILE
exit 0
fi
# implicit 'else'
oldpid=`cat $PIDFILE`
if [ $thispid -ne $oldpid ]
then
echo New pid for $1: $thispid
echo -n $thispid  $PIDFILE
exit 1
else
exit 0
fi
# 


$ ./pidcheck.sh apache2
$ ./pidcheck.sh apache2
$ sudo /etc/init.d/apache2 restart
  * Restarting web server apache2
...done.
$ ./pidcheck.sh apache2
New pid for apache2: 3125
$ echo $?
1
$ ./pidcheck.sh apache2
$ echo $?
0

--
Roy Sigurd Karlsbakk
(+47) 97542685 / 98013356
r...@karlsbakk.net
--
I all pedagogikk er det essensielt at pensum presenteres  
intelligibelt. Det er en elementært imperativ for alle pedagoger å  
unngå eksessiv anvendelse av idiomer med fremmed opprinnelse. I de  
fleste tilfeller eksisterer adekvate og relevante synonymer på norsk.


--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
___
Nagios-users mailing list
Nagios-users@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


Re: [Nagios-users] No notifications while restarting any services on remote host

2009-04-14 Thread Roy Sigurd Karlsbakk

 When you restart something like a tomcat server, it takes to short a  
 time for Nagios to notice. If you want a notice when something is  
 restarted, write a script that checks the root PID of the process  
 and make this generate an email. I don't Nagios is very well suited  
 for this operation, but a small script written in your favourite  
 language can do it without much problems. Example:


There were a few errors in that - see this for fewer bugs: Fixed up  
version here http://karlsbakk.net/nagios/pidcheck.sh.txt
--
Roy Sigurd Karlsbakk
(+47) 97542685 / 98013356
r...@karlsbakk.net
--
I all pedagogikk er det essensielt at pensum presenteres  
intelligibelt. Det er en elementært imperativ for alle pedagoger å  
unngå eksessiv anvendelse av idiomer med fremmed opprinnelse. I de  
fleste tilfeller eksisterer adekvate og relevante synonymer på norsk.


--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
___
Nagios-users mailing list
Nagios-users@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


Re: [Nagios-users] No notifications while restarting any services on remote host

2009-04-14 Thread Jim Avery
2009/4/14 Kaushal Shriyan kaushalshri...@gmail.com:
 Hi,

 When i restart any services on the remote client For example tomcat
 application server running on port 8080. I dont get any notifications or
 alerts. Just want to understand the technique is it because of the
 normal_check_interval  5 configured in services.cfg and interval_length=60
 defined in nagios.cfg.

 Please explain.

 Thanks and Regards

 Kaushal

With those settings, Nagios will check the service every five minutes.
 If you restart the service in between those checks, Nagios will not
notice.  Even if Nagios does notice, it won't send you a notification
until the specified number of retries specified by max_check_attempts.
 Make sure notifications are enabled, and that you have the correct
notification_options set.  A common error is accidentally to set the
n option in notification_options which disables all notifications
for that service.  Another parameter which can have an effect on
whether notifications are sent (new in 3.0 Nagios) is
first_notification_delay.

I assume you are using the check_http plugin, as you haven't said.

If you want to be notified even for very short duration outages,
you're probably best off checking the event log and/or one or more of
the tomcat logs too.

hth,

Jim

--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
___
Nagios-users mailing list
Nagios-users@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