On Fri, 03 Jul 2009, Gaurav Ghimire wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Dear all, > > I am off to write up a script for notification of Host status. Doing so to > integrate more information in the notification email such as latest > Syslog messages from the network device, the uptime and bla bla. Here I am in > a need to have some checks made on the basis of Hostgroups. But > what came up as a problem is a host that is in multiple host group. For the > check i used $HOSTGROUPNAME$ but it if a host is in two hostgroups. > nagios docs state that it could be any one of them. Then the thing > $HOSTGROUPALIAS$ struck me. Is it the same as the other. Or are there any > other medium where I can make nagios provide me with the exact > $HOSTGROUPNAME$ i want in the macro itself. > > Say I have two hostgroups A and B and the host C is in both the host groups. > And I only want the $HOSTGROUPNAME$ macro give me A is there any > way? or any other references? I would be grateful for any directions or helps.
I may be misunderstanding, but if you have a host in multiple hostgroups, but you only want your notification to list one of them, you know what that one hostgroup is, right? If that's the case, don't use the macro. There's no way for Nagios to know which of the multiple hostgroups is the one you want, and there's no need for a macro at all if you know which hostgroup you want listed. If you're using Nagios 3, custom variables may also be an option. ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ Nagios-users mailing list [email protected] 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
