Time-Wasting Tricks

Marc Powell marc at ena.com
Fri Mar 18 15:12:06 CET 2005



> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of Chris Wilson
> Sent: Friday, March 18, 2005 7:37 AM
> To: Nagios Users
> Subject: [Nagios-users] Time-Wasting Tricks
> 
> Hi all,
> 
> I'm looking at the Nagios 1.x Time-Saving Tricks page
> [http://nagios.sourceforge.net/docs/1_0/templatetricks.html], and
trying
> to implement a single service for all hosts in a hostgroup. This would
> indeed save me a lot of time. However, I get the following error when
> starting Nagios:
> 
>         Error: Host name 'prod.aidworld.org www1.loband.org
>         mail.aidworld.org www3.loband.org www4.loband.org
>         www5.loband.org www6.loband.org' for service 'ssh' exceeds
>         maximum length of 63 characters
> 
> Is there some way to increase the limit of 63 characters, or make this
> "trick" useful in some way, apart from splitting my hostgroups which
> will break all of my configuration?

The hostnames should be comma-separated. 

	define service{
		host_name		HOST1,HOST2,HOST3,...,HOSTN
		service_description	SOMESERVICE
		other service directives ...
		}

On the off chance that doesn't work for you, you could try increasing
'common/objects.h:#define MAX_HOSTNAME_LENGTH' but I am not personally
aware of anyone that's done that so I can't say what the consequences
would be. The preferred solution would then be to use the hostgroup_name
directive as follows --


	define service{
		hostgroup_name
HOSTGROUP1,HOSTGROUP2,...,HOSTGROUPN
		service_description	SOMESERVICE
		other service directives ...
		}

Hosts can be members of multiple host groups. Simply create an arbitrary
hostgroup for hosts with this service and assign it to the service as
above. If you're using CGI authentication you can even hide it from the
hostgroup views by assigning to it a contact group that no-one is a
member of.


--
Marc


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
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