host name problem
Brian Smith
brian.smith at worldpub.net
Tue Sep 12 20:56:54 CEST 2006
Tom,
Thanks for the response.
I am aware that that the service_description definition is optional.
But it works fine if I change earth to dev-earth. I think this is a bug
in the serviceextinfo regular expression match for the host_name. earth
and earthquake should not match, as they are different but nagios is
insisting they are the same hostname. I can recreate this error by
creating 2 hosts, a service both hosts are in and the serviceextinfo
settings for both hosts, 1 host has the name embedded like, storm and
sandstorm, earth and earthquake ...... but earth1 and earth2 will work.
tom.welsh at bt.com wrote:
> Hi Brian,
>
> You don't need to specify the service_description in the serviceextinfo
> file see the docs...
>
> Info taken from Extended Service Information Definition
>
> Description:
>
> Extended service information entries are basically used to make the
> output from the status and extinfo CGIs look pretty. They have no effect
> on monitoring and are completely optional.
>
>
> Definition Format:
>
> Note: Variables in red are required, while those in black are optional.
> However, you need to supply at least one optional variable in each
> definition for it to be of much use.
>
> define serviceextinfo{
> host_name host_name
> service_description service_description
> notes note_string
> notes_url url
> action_url url
> icon_image image_file
> icon_image_alt alt_string
> }
>
>
>
> Example Definition:
>
>
> define serviceextinfo{
> host_name linux2
> service_description Log Anomalies
> notes Security-related log anomalies on
> secondary Linux server
> notes_url
> http://webserver.localhost.localdomain/serviceinfo.pl?host=linux2&servic
> e=Log+Anomalies
> icon_image security.png
> icon_image_alt Security-Related Alerts
> }
>
>
>
>
>
>
> -----Original Message-----
> From: nagios-users-bounces at lists.sourceforge.net
> [mailto:nagios-users-bounces at lists.sourceforge.net] On Behalf Of Brian
> Smith
> Sent: 12 September 2006 18:36
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] host name problem
>
> Hello all, does anyone know why the following problem occurs:
>
> I have some hosts having duplicate name issues when adding the
> serviceextinfo information for those hosts.
> Host 1 is called earth, host 2 is called earthquake.
> Here's the hosts.cfg definition:
>
> ------------------------------------------------------------------------
> -----
> define host{
> name generic-host
> notifications_enabled 1
> event_handler_enabled 1
> flap_detection_enabled 1
> failure_prediction_enabled 1
> process_perf_data 1
> retain_status_information 1
> retain_nonstatus_information 0
> register 0
> }
>
>
> define host{
> use generic-host ; Name of host
> template to use
> host_name earth
> alias earth
> address 127.0.0.1
> check_command check-host-alive
> max_check_attempts 10
> notification_interval 120
> notification_period 24x7
> notification_options d,r
> contact_groups admins
> }
>
> define host{
> use generic-host ; Name of host
> template to use
> host_name earthquake
> alias earthquake
> address 127.0.0.1
> check_command check-host-alive
> max_check_attempts 10
> notification_interval 120
> notification_period 24x7
> notification_options d,r
> contact_groups admins
> }
> ------------------------------------------------------------------------
> ----------------------------------------------
>
> And here is the services.cfg
>
> ------------------------------------------------------------------------
> ------------------------------------
> define service{
> name generic-service
> active_checks_enabled 1
> passive_checks_enabled 1
> parallelize_check 1
> obsess_over_service 1
> check_freshness 0
> notifications_enabled 1
> event_handler_enabled 1
> flap_detection_enabled 1
> failure_prediction_enabled 1
> process_perf_data 1
> retain_status_information 1
> retain_nonstatus_information 0
> register 0
> }
>
> define service{
> use generic-service ; Name
> of service template to use
> host_name earth,earthquake
> service_description PING
> is_volatile 0
> check_period 24x7
> max_check_attempts 2
> normal_check_interval 5
> retry_check_interval 1
> contact_groups admins
> notification_options w,u,c,r
> notification_interval 60
> notification_period 24x7
> check_command check_ping!100.0,20%!500.0,60%
> }
> ------------------------------------------------------------------------
> --------------------------------------------------
>
> Everything works great now, until i add some serviceextinfo:
> serviceextinfo.cfg:
>
> ------------------------------------------------------------------------
> -----------------------------------
> define serviceextinfo{
> host_name earthquake
> icon_image dot.png' border="0"></a><A
> TARGET="_blank" HREF="graphs.cgi?host=earthquake&service=PING"><img
> src='/nagios/cgi-bin/rrd2-system.cgi?host=earthquake&service=PING&start=
> -5400&title=Actual&width=20&height=20&type=AVERAGE&only-graph=true'
> service_description PING
> notes_url https://wiki/$HOSTNAME$-$SERVICEDESC$
> }
>
> define serviceextinfo{
> host_name earth
> icon_image dot.png' border="0"></a><A
> TARGET="_blank" HREF="graphs.cgi?host=earth&service=PING"><img
> src='/nagios/cgi-bin/rrd2-system.cgi?host=earth&service=PING&start=-5400
> &title=Actual&width=20&height=20&type=AVERAGE&only-graph=true'
> service_description PING
> notes_url https://wiki/$HOSTNAME$-$SERVICEDESC$
> }
> ------------------------------------------------------------------------
> ------------------------------------------------------------------------
> -
> Ok, now when I run ../bin/nagios -v ./nagios.cfg I get the error:
>
> root at nagios:/opt/nagios/etc# ../bin/nagios -v ./nagios.cfg
>
> Nagios 2.5
> Copyright (c) 1999-2006 Ethan Galstad (http://www.nagios.org) Last
> Modified: 07-13-2006
> License: GPL
>
> Reading configuration data...
>
> Error: Could not add duplicate serviceextinfo entry for service 'PING'
> on host 'earthquake'.
> Error: Could not allocate memory for serviceextinfo list to add extended
> info for service 'PING' on host 'earthquake'.
> Error: Could not register extended service information (config file
> '/opt/nagios/etc/checkcommands.cfg', starting on line 135111232)
>
> Any suggestions on getting the serviceextinfo.cfg entries working for
> these 2 hosts? It works if I only have one of the hosts in the cfg
> file?
> Thanks!
>
> Brian Smith
>
>
>
> ------------------------------------------------------------------------
> -
> 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