Discussion:
[Nagios-users] Host-based service check period
Francis Dube
2008-10-15 15:20:09 UTC
Permalink
Hi everyone,

I'm using Nagios to monitor many hosts with services running at
different time. Each host is connected to a Plasma TV and display
publicity on it, but the all are installed in different public area with
different working hours.

Ex :
Host #1 is in a restaurant, so the services are running from 6:00 to 21:00.
Host #2 is in a bar, so the services are running from 12:00 to 3:00.
Host #3 is in a mall, so the services are running from 9:00 to 17:00 on
week days.

To save power, we turn off the display during the non-working hours, but
we need the Nagios check to stop at the same time. The check_period
instruction in the host definition only affect the check-host-alive
command and not the services check. I've read all i've found about the
timeperiod and such, but i cant find a way to do host-based service
check period. I would like to create a timeperiod for each host and that
all the check for this host (service and host-alive) stop/start
according to that timeperiod. Anybody knows a way to do this ?

Thanks for your time !

Francis Dube
R&D - Optik Securite
www.optiksecurite.com
Marc Powell
2008-10-15 16:49:03 UTC
Permalink
Post by Francis Dube
check period. I would like to create a timeperiod for each host and that
all the check for this host (service and host-alive) stop/start
according to that timeperiod. Anybody knows a way to do this ?
Host and services have historically been separate entities for the
most part with no inheritance between them at all. With nagios-3,
there is some inheritance happening now between a service and it's
host but only for three variables (contact_groups,
notification_interval and notification_period: http://nagios.sourceforge.net/docs/3_0/objectinheritance.html#implied_inheritance)
. check_period isn't an inheritable property and the most direct way
to a solution is to simply specify the same check_period name for the
services that you are using for the host.

--
Marc
Marc Powell
2008-10-15 17:52:10 UTC
Permalink
Yeah but if I specify the same check_period name for the service, I
have to define a service for every host (ex : a check_service_host1,
check_service_host2, and so on..) because the services running on
each hosts are running at different hours.
Correct. The possibility does exist that you've chosen a config
management scheme that doesn't meet your needs. Template shortcuts are
nice but you can lose a lot of flexibility.
I'll take a look at notification_period inheritance, it may be a
good work around too.
I agree, if you don't mind that the checks still happen.

--
Marc
Francis Dube
2008-10-15 17:21:21 UTC
Permalink
=20
check period. I would like to create a timeperiod for each host an=
d =20
that
all the check for this host (service and host-alive) stop/start
according to that timeperiod. Anybody knows a way to do this ?
=20
Host and services have historically been separate entities for the =
=20
most part with no inheritance between them at all. With nagios-3, =
=20
there is some inheritance happening now between a service and it's =
=20
host but only for three variables (contact_groups, =20
notification_interval and notification_period: http://nagios.source=
forge.net/docs/3_0/objectinheritance.html#implied_inheritance)=20
. check_period isn't an inheritable property and the most direct wa=
y =20
to a solution is to simply specify the same check_period name for t=
he =20
services that you are using for the host.
--
Marc
-------------------------------------------------------------------=
------
This SF.Net email is sponsored by the Moblin Your Move Developer's =
challenge
Build the coolest Linux based applications with Moblin SDK & win gr=
eat prizes
Grand prize is a trip for two to an Open Source event anywhere in t=
he world
http://moblin-contest.org/redirect.php?banner_id=3D100&url=3D/
_______________________________________________
Nagios-users mailing list
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when =
reporting any issue.=20
::: Messages without supporting info will risk being sent to /dev/n=
ull
=20
Yeah but if I specify the same check_period name for the service, I h=
ave=20
to define a service for every host (ex : a check_service_host1,=20
check_service_host2, and so on..) because the services running on eac=
h=20
hosts are running at different hours.

I'll take a look at notification_period inheritance, it may be a good=
=20
work around too.

Thanks for the info.

Francis Dube
R&D
www.optiksecurite.com
jeremiah
2008-10-15 17:06:57 UTC
Permalink
Any thoughts on these errors? I'm stumped.

Checking services...

Error: Service check command 'check_ssh' specified in service 'SSH' for
host 'server1' not defined anywhere!
Error: Service check command 'check_ssh' specified in service 'SSH' for
host 'server2' not defined anywhere!

Services page looks like this..

define service{
use generic-service
hostgroup_name ssh_servers
service_description SSH
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 3
retry_check_interval 1
contact_groups admins
notification_interval 30
notification_period 24x7
notification_options w,u,c,r
check_command check_ssh
}

Thanks!



Disclaimer: The information contained in this transmission, including any
attachments, may contain confidential information of Panasonic Avionics
Corporation. This transmission is intended only for the use of the
addressee(s) listed above. Unauthorized review, dissemination or other use
of the information contained in this transmission is strictly prohibited.
If you have received this transmission in error or have reason to believe
you are not authorized to receive it, please notify the sender by return
email and promptly delete the transmission.
Francis Dube
2008-10-15 17:20:18 UTC
Permalink
Post by jeremiah
Any thoughts on these errors? I'm stumped.
Checking services...
Error: Service check command 'check_ssh' specified in service 'SSH'=
for
Post by jeremiah
host 'server1' not defined anywhere!
Error: Service check command 'check_ssh' specified in service 'SSH'=
for
Post by jeremiah
host 'server2' not defined anywhere!
Services page looks like this..
define service{
use generic-service =
=20
Post by jeremiah
hostgroup_name ssh_servers
service_description SSH
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 3
retry_check_interval 1
contact_groups admins
notification_interval 30
notification_period 24x7
notification_options w,u,c,r
check_command check_ssh
}
Thanks!
Disclaimer: The information contained in this transmission, includi=
ng any=20
Post by jeremiah
attachments, may contain confidential information of Panasonic Avio=
nics
Post by jeremiah
Corporation. This transmission is intended only for the use of the=
=20
Post by jeremiah
addressee(s) listed above. Unauthorized review, dissemination or o=
ther use=20
Post by jeremiah
of the information contained in this transmission is strictly prohi=
bited.=20
Post by jeremiah
If you have received this transmission in error or have reason to b=
elieve=20
Post by jeremiah
you are not authorized to receive it, please notify the sender by r=
eturn=20
Post by jeremiah
email and promptly delete the transmission.
-------------------------------------------------------------------=
------
Post by jeremiah
This SF.Net email is sponsored by the Moblin Your Move Developer's =
challenge
Post by jeremiah
Build the coolest Linux based applications with Moblin SDK & win gr=
eat prizes
Post by jeremiah
Grand prize is a trip for two to an Open Source event anywhere in t=
he world
Post by jeremiah
http://moblin-contest.org/redirect.php?banner_id=3D100&url=3D/
_______________________________________________
Nagios-users mailing list
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when =
reporting any issue.=20
Post by jeremiah
::: Messages without supporting info will risk being sent to /dev/n=
ull
Post by jeremiah
=20
You need to define this command in your command.cfg file. A check_ssh=
=20
command usually looks like this :

# 'check_ssh' command definition
define command{
command_name check_ssh
command_line $USER1$/check_ssh -H $HOSTADDRESS$
}


Francis Dube
R&D - Optik Securite
www.optiksecurite.com
jeremiah
2008-10-15 17:58:39 UTC
Permalink
Any ideas?

~$ sudo /etc/init.d/nagios2 start
[sudo] password for user:
* Starting nagios2 monitoring daemon nagios2
kill: 1: No such process


[ OK ]

Thanks!


Disclaimer: The information contained in this transmission, including any
attachments, may contain confidential information of Panasonic Avionics
Corporation. This transmission is intended only for the use of the
addressee(s) listed above. Unauthorized review, dissemination or other use
of the information contained in this transmission is strictly prohibited.
If you have received this transmission in error or have reason to believe
you are not authorized to receive it, please notify the sender by return
email and promptly delete the transmission.
Marc Powell
2008-10-15 19:42:39 UTC
Permalink
Post by jeremiah
Any ideas?
~$ sudo /etc/init.d/nagios2 start
* Starting nagios2 monitoring daemon nagios2
kill: 1: No such process
Eliminate sudo as a culprit. Can you run it directly as root --

/etc/init.d/nagios2 start
or
/path/to/nagios/bin/nagios
or
/path/to/nagios/bin/nagios -v /path/to/nagios/etc/nagios.cfg
or
/path/to/nagios/bin/nagios -d /path/to/nagios/etc/nagios.cfg

Did you happen to mount the partition that the nagios binary lives in
with noexec?

What OS is this on?

--
Marc
Gürkan Aslan
2008-10-16 07:01:56 UTC
Permalink
Hi,

/etc/init.d/nagios2 script trying to kill something in "start" case. You
can check it by editing the /etc/init.d/nagios2 file content.

Regards
Post by jeremiah
Any ideas?
~$ sudo /etc/init.d/nagios2 start
* Starting nagios2 monitoring daemon nagios2
kill: 1: No such process
[ OK ]
--
Gürkan Aslan
Senior Developer
Komturk Iletisim Ltd. Sti
Phone: +90 212 275 88 99 ext 125
Valdinger, Stephen (DOV, MSX)
2008-10-15 19:04:56 UTC
Permalink
Where did you get a nagios2 binary? The Ubuntu repos? I've never seen
that before.

Stephen Valdinger
MIS Helpdesk Coordinator
330.365.3622 -O
740.491.0958 - C
***@doverchem.com
Never agrue with an idiot. They drag you down to their level and then
beat you with their experience.

-----Original Message-----
From: jeremiah [mailto:***@panasonic.aero]
Sent: Wednesday, October 15, 2008 1:59 PM
To: nagios-***@lists.sourceforge.net
Subject: [Nagios-users] nagios not starting

Any ideas?

~$ sudo /etc/init.d/nagios2 start
[sudo] password for user:
* Starting nagios2 monitoring daemon nagios2
kill: 1: No such process


[ OK ]

Thanks!


Disclaimer: The information contained in this transmission, including
any
attachments, may contain confidential information of Panasonic Avionics
Corporation. This transmission is intended only for the use of the
addressee(s) listed above. Unauthorized review, dissemination or other
use
of the information contained in this transmission is strictly
prohibited.
If you have received this transmission in error or have reason to
believe
you are not authorized to receive it, please notify the sender by return

email and promptly delete the transmission.



------------------------------------------------------------------------
-
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the
world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Nagios-users mailing list
Nagios-***@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
Continue reading on narkive:
Loading...