<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>Hi Mark<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Sorry for the lack of clarity.  Learned a valuable lesson in “don’t email before coffee”… :)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>I was successful in altering the Host Check Command for the individual host – that was clear from the documentation.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>I am trying to remove this host from the “ping-servers” without altering the definition for the service or the hostgroup.  So right now, the service and hostgroup’s are defined as:<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:#1F497D'>define service {<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:#1F497D'>        hostgroup_name          ping-servers<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:#1F497D'>        service_description     PING<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:#1F497D'>        check_command           check_ping!50.0,20%!100.0,60%<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:#1F497D'>        use                     generic-service,graphed-service<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:#1F497D'>}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:#1F497D'>define hostgroup {<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:#1F497D'>        hostgroup_name          ping-servers<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:#1F497D'>        alias                   Pingable hosts<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:#1F497D'>        members                 *<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:#1F497D'>}<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>And the new host, outsidefirewallhost, I would like to exclude from the ‘ping-servers’ service – but without modifying the definitions for the service or the hostrgroup.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>I have tried Brandon Phelps’ suggestion, but as he found out, Nagios doesn’t like the negation in the host configuration.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>I have been successful with this:<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:#1F497D'>define hostgroup {<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:#1F497D'>        hostgroup_name          ping-servers<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:#1F497D'>        alias                   Pingable hosts<o:p></o:p></span></p><p class=MsoNormal><b><span style='font-family:"Courier New";color:#1F497D'>        members                 *,!outsidefirewallhost<o:p></o:p></span></b></p><p class=MsoNormal><span style='font-family:"Courier New";color:#1F497D'>}<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Should I just get over my personal hang-ups and implement it this way?<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Thanks again,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Tim<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Frost, Mark {PBC} [mailto:mark.frost1@pepsico.com] <br><b>Sent:</b> Tuesday, November 08, 2011 8:37 AM<br><b>To:</b> Nagios Users List<br><b>Subject:</b> Re: [Nagios-users] Hostgroup tricks?<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Tim AtLee [mailto:T.AtLee@cfertech.com] <br><b>Sent:</b> Tuesday, November 08, 2011 9:46 AM<br><b>To:</b> nagios-users@lists.sourceforge.net<br><b>Subject:</b> [Nagios-users] Hostgroup tricks?<o:p></o:p></span></p></div></div><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><p class=MsoNormal style='margin-left:.5in'>Hello<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><p class=MsoNormal style='margin-left:.5in'>I have a hostgroup defined as:<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>define hostgroup {<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>        hostgroup_name          ping-servers<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>        alias                   Pingable hosts<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>        members                 *<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>}<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><p class=MsoNormal style='margin-left:.5in'>I have recently added a host outside our firewall that has ping disabled.  I have changed the host’s check_command to be ‘check_tcp!80’ so that the host won’t be offline permanently, but I am wondering if there is a way to exclude this host from the ‘ping-servers’ hostgroup in the host definition?<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><p class=MsoNormal style='margin-left:.5in'>Ideally, something like:<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>define host {<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>        host_name       outsidefirewallhost<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>        alias           Host outside firewall<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>        address         some.ip.address<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>        use             generic-host<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>        hostgroup    !ping-servers<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>}<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><p class=MsoNormal style='margin-left:.5in'>This generates an error when I test the configuration.  The only way I have been able to achieve this is to change the ping-servers hostgroup definition to exclude this individual host (*,!outsidefirewallhost), but I’d rather keep the exclusion define in the host, not in the “blanket rule”.<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><p class=MsoNormal style='margin-left:.5in'>Maybe it’s just me being OCD…  but is this possible?<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><p class=MsoNormal style='margin-left:.5in'>Thanks,<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><p class=MsoNormal style='margin-left:.5in'>Tim<o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Tim,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>I'm a  little unclear about your question.  Are you trying to alter the "Host Check Command" for a single host definition?  That is, the method used by Nagios to determine if a host is up or not?  If that's the case, you can just override the definition for that one host:<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>define host {<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>        host_name       outsidefirewallhost<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>        alias           Host outside firewall<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>        address         some.ip.address<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>        check_command   check-tcp-port-80<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>        use             generic-host<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>}<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Check the docs for information on precedence, but your "generic-host" inclusion will specify a check_command (usually ping or better yet fping), but defining a different value in the definition itself can override that for the specific definition.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>If that's not what you mean, and you want to change a specific service to check everything in that hostgroup except that one host, that would look something like<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>define service {<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><b><span style='font-family:"Courier New"'>        hostgroup_name  ping-servers<o:p></o:p></span></b></p><p class=MsoNormal style='margin-left:.5in'><b><span style='font-family:"Courier New"'>        host_name       !outsidefirewallhost<o:p></o:p></span></b></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>        service_description           My Service<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>        check_command   run-a-ping<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>        use             generic-service<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>}<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Hopefully I've understood your question…<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Mark<o:p></o:p></span></p></div></body></html>