<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 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
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-GB" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">I am using Xymon 4.3.28.  I've had problems with the script 'server/etc/apcsnmp.pl' attempting to apply SNMP checks to systems where no such checks are defined.  For example, the following line in my hosts.cfg:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><IP address> xxx-test01.<domain> # NAME:xxx-test01<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">…results in the SNMP 'test' check being applied to system xxx-test01, even though no such check is asked for.  This appears to be owing to the way hosts.cfg is parsed by apcsnmp.pl: it looks for various strings, such as "test", appearing
 /anywhere/ within each line of hosts.cfg, not simply as keywords.  I have edited my copy of apcsnmp.pl such that it will look for each of these strings only where it is preceded by a space character or a tab character, and only where it ends at a word boundary. 
 (I did not want to use Perl's '\s' regex shorthand in the check for whitespace before the string, because this would also match newlines.)  This will prevent checks being applied because their names form part of a larger string. 
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">A side-effect of making this change was that the 'volt' checks we had defined for our UPSs stopped working.  This was because these checks had been specified as "voltage" in our hosts.cfg.  Changing these checks to read "volt" cured this
 problem.  I do not know whether that use of "voltage" in hosts.cfg was a peculiarity of ours, or whether it came from some sort of predefined Xymon configuration. 
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I attach a copy of our revised apcsnmp.pl script, in case you would like to merge this in to your main branch.  I also attach a Zip version of it, in case your mail system will not allow Perl scripts as attachments. 
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Regards<o:p></o:p></p>
<p class="MsoNormal">Ed<o:p></o:p></p>
</div>
<br>
Rothamsted Research is a company limited by guarantee, registered in England at Harpenden, Hertfordshire, AL5 2JQ under the registration number 2393175 and a not for profit charity number 802038.
</body>
</html>