templates or USERx in hostgroups.cfg not working?
Marc Powell
marc at ena.com
Fri Jul 29 17:37:48 CEST 2005
> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of Brian Smith
> Sent: Thursday, July 28, 2005 7:04 PM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] templates or USERx in hostgroups.cfg not
working?
>
>
> I'm banging my head on a wall with this so any help is greatly
> appreciated... Nagios version is 1.2 Stable Release.
>
> Problem: I cannot seem to get template definitions or $USERx$ vars
> defined in resource.cfg to apply settings in hostgroups.cfg. Are
these
> not supported for that config file or something?
The config file name doesn't matter. As long as it's listed as a
cfg_file in nagios.cfg then it's treated the same as any other cfg_file.
> I've tried the following for templates:
>
> ### in central hostgroups.cfg
>
> define hostgroup {
> hostgroup_name gengroup
> contact_groups people
> register 0
> }
You probably mean to change 'hostgroup_name' to 'name'. You reference a
template called 'gengroup' below, but there is no corresponding template
named 'gengroup'.
http://nagios.sourceforge.net/docs/1_0/templaterecursion.html
define hostgroup {
name gengroup
contact_groups people
register 0
}
>
>
> ### in site specific hostgroups.cfg
>
> define hostgroup {
> use gengroup
> hostgroup_name sitename
> alias descriptive stuff
> members list_of_hosts, more_hosts, etc_hosts
> }
>
>
>
> and also tried the following for the $USERx$ variable:
>
> ### in resource.cfg
>
> $USER1$=/usr/nagios/libexec
> $USER2$=people
>
>
> ### in site specific hostgroups.cfg
>
> define hostgroup {
> use gengroup
> hostgroup_name sitename
> alias descriptive stuff
> contact_groups $USER2$
> members list_of_hosts, more_hosts, etc_hosts
> }
To the best of my knowledge, and a review of the documentation on using
them, macros are only available for use in the command definitions (e.g.
command_line); therefore the above would not be valid.
http://nagios.sourceforge.net/docs/1_0/macros.html
"One of the features available in Nagios is the ability to use macros in
command definitions. Immediately prior to the execution of a command,
Nagios will replace all macros in the command with their corresponding
values. This allows you to define a few generic commands to handle all
your needs."
I would say that your test confirms that.
--
Marc
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
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