{"id":24,"date":"2011-12-04T16:40:30","date_gmt":"2011-12-04T15:40:30","guid":{"rendered":"http:\/\/labalec.fr\/erwan\/?page_id=24"},"modified":"2015-12-27T16:18:08","modified_gmt":"2015-12-27T15:18:08","slug":"page-test","status":"publish","type":"page","link":"https:\/\/labalec.fr\/erwan\/?page_id=24","title":{"rendered":"SnmpTools"},"content":{"rendered":"<p>SnmpTools is an snmp agent servicing all windows performance counters thus allowing tools such as MRTG or Cacti to retrieve windows performance values (cpu, memory, disk, etc.). Discussion takes place <a href=\"http:\/\/forums.cacti.net\/about25600.html\">here<\/a><br \/>\nIndex<\/p>\n<p><a href=\"#install\">Installation<\/a><br \/>\n<a href=\"#usage\">Usage<\/a><br \/>\n<a href=\"#getnext\">SNMP Get Next support<\/a><br \/>\n<a href=\"#values\">Value Types<\/a><br \/>\n<a href=\"#debug\">Debug<\/a><br \/>\n<a href=\"#traps\">Traps<\/a><br \/>\n<a href=\"#64bits\">Windows 64 bits support<\/a><br \/>\n<a href=\"#download\">Download<\/a><\/p>\n<p><a name=\"install\"><\/a><span style=\"font-size: medium;\"><strong>Installation<\/strong><\/span><\/p>\n<ol>\n<li>Copy snmptools.dll to system32 (on x32) or windows (on x64)<\/li>\n<\/ol>\n<ol start=\"2\">\n<li>Register the snmp agent by using the regagent.reg file<\/li>\n<\/ol>\n<ol start=\"3\">\n<li>Create your ini file (an example is provided)<\/li>\n<\/ol>\n<ol start=\"4\">\n<li>Restart the snmp service<\/li>\n<\/ol>\n<ol start=\"5\">\n<li>Test that the agent is running by issue a snmpget command on 1.3.6.1.4.1.15 : it should return the string &lsquo;snmptools&rsquo;<\/li>\n<\/ol>\n<p><a name=\"usage\"><\/a><span style=\"font-size: medium;\"><strong>Usage<\/strong><\/span><\/p>\n<p><span style=\"font-family: Times New Roman,serif;\">Create a definition file (c:\\counters.ini<\/span> <span style=\"font-family: Times New Roman,serif;\">for example as defined by default in the reg file) where you will define your oid&rsquo;s and the value that should be returned (a counter, a string, or the output of an executable).<\/span><\/p>\n<p><span style=\"font-family: Times New Roman,serif;\">Note: Counters have to be in english.<\/span><\/p>\n<p><span style=\"font-family: Times New Roman,serif;\">Example :<\/span><\/p>\n<p><span style=\"font-family: Times New Roman,serif;\">[1.3.6.1.4.1.15.1]<\/span><\/p>\n<p><span style=\"font-family: Times New Roman,serif;\">counter=LogicalDisk\\Free Megabytes\\_Total<\/span><\/p>\n<p><span style=\"font-family: Times New Roman,serif;\">[1.3.6.1.4.1.15.2]<\/span><\/p>\n<p><span style=\"font-family: Times New Roman,serif;\">type=string<\/span><\/p>\n<p><span style=\"font-family: Times New Roman,serif;\">counter=this is a test<\/span><\/p>\n<p><span style=\"font-family: Times New Roman,serif;\">[1.3.6.1.4.1.15.3]<\/span><\/p>\n<p><span style=\"font-family: Times New Roman,serif;\">type=exec<\/span><\/p>\n<p><span style=\"font-family: Times New Roman,serif;\">counter=cscript \/nologo c:\\test.vbs<\/span><\/p>\n<p><a name=\"getnext\"><\/a><span style=\"font-size: medium;\"><strong>SNMP Get Next support<\/strong><\/span><br \/>\nsnmpwalk -v 2c -c public 127.0.0.1 1.3.6.1.4.1.15 will walk to the first defined in the definition file (here above 1.3.6.1.4.1.15.1).<\/p>\n<p>snmpwalk -v 2c -c public 127.0.0.1 1.3.6.1.4.1.15.1 will walk to the next oid (here above 1.3.6.1.4.1.15.1.2).<\/p>\n<p>Note : the next oid means the next one in the definition file (snmptools will not re order them for you).<\/p>\n<p><a name=\"values\"><\/a><span style=\"font-size: medium;\"><strong>Returned value types<\/strong><\/span><\/p>\n<p>Whole numbers will be sent as snmp type=asn_integer32 (2) or type=asn_counter64 (3) (only with snmpv2 and up).<\/p>\n<p>Other value types will be sent as snmp type=asn_string (4).<\/p>\n<p>Float values will always use &lsquo;.&rsquo; as separator.<\/p>\n<p>Return value should not have a line return.<\/p>\n<p><a name=\"debug\"><\/a><span style=\"font-size: medium;\"><strong>Debug<\/strong><\/span><br \/>\n<span style=\"font-family: Times New Roman,serif;\">Put debug=\u00a0\u00bb1&Prime; (string) under [HKEY_LOCAL_MACHINE\\SOFTWARE\\snmptools\\currentversion] to debug to c:\\log.txt.<\/span><\/p>\n<p><a name=\"traps\"><\/a><strong><span style=\"font-size: medium;\">Traps<\/span><\/strong><br \/>\nSnmpTools agent can (this is an option) send trap to trap listeners (udp port 162).<\/p>\n<p>1. configure the MS SNMP service (in the traps tab, add the ip of the snmp workstations that should receive the traps).<\/p>\n<p>2. add the following registry key under [HKEY_LOCAL_MACHINE\\SOFTWARE\\snmptools\\currentversion] :<\/p>\n<p>traps = \u00ab\u00a0c:\\traps.ini\u00a0\u00bb (string)<\/p>\n<p>Optionally, you may add trap_delay = 60000 (dword) if you wish to set the delay between each run to 60 secs (15 secs by default)<\/p>\n<p>3. Create a traps.ini like this :<\/p>\n<p>[1.3.6.1.4.1.15.10.1]<\/p>\n<p>script=cscript \/nologo c:\\trap1.vbs<\/p>\n<p>[1.3.6.1.4.1.15.10.2]<\/p>\n<p>script=cscript \/nologo c:\\trap2.vbs<\/p>\n<p>Note : then VBS can return either a string or an integer. If the returned value is empty, the agent will send a varbindlist with len=0.<\/p>\n<p><a name=\"64bits\"><\/a><span style=\"font-size: medium;\"><strong>Windows 64 bits support<\/strong><\/span><\/p>\n<p>Use the snmptools.dll 32 bits version on windows 64 bits platform by using regagentWow6432.reg and copy the DLL file to the syswow64 folder then, <strong>not system32<\/strong>.<\/p>\n<p>The registry configuration key on x64 systems is [HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\snmptools\\currentversion] and <strong>no more<\/strong> [HKEY_LOCAL_MACHINE\\SOFTWARE\\snmptools\\currentversion].<\/p>\n<p><strong>Download<\/strong><a name=\"download\"><\/a><\/p>\n<p lang=\"en-GB\">Version: <strong>2.0.0.18<\/strong><br \/>\nSize: 290 <strong>Kb <\/strong><\/p>\n<p>Download (zip) : <a href=\"https:\/\/erwan.labalec.fr\/snmptools\/snmptools2.zip\">snmptools2.zip<\/a><br \/>\nDownload (setup) : <a href=\"https:\/\/erwan.labalec.fr\/snmptools\/snmptools32.exe\">snmptools32.exe<\/a><br \/>\nHistory:\u00a0<a href=\"https:\/\/erwan.labalec.fr\/snmptools\/history.txt\"><strong>history.txt<\/strong><\/a><\/p>\n<p>Author: <a href=\"mailto:erwan.l@free.fr\"><strong>Erwan<\/strong><\/a><\/p>\n<p lang=\"en-GB\">Last Released on: <strong>Nov-2012<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>SnmpTools is an snmp agent servicing all windows performance counters thus allowing tools such as MRTG or Cacti to retrieve windows performance values (cpu, memory, disk, etc.). Discussion takes place here Index Installation Usage SNMP Get Next support Value Types Debug Traps Windows 64 bits support Download Installation Copy snmptools.dll to system32 (on x32) or <a href='https:\/\/labalec.fr\/erwan\/?page_id=24' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-24","page","type-page","status-publish","hentry","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/pages\/24","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=24"}],"version-history":[{"count":24,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/pages\/24\/revisions"}],"predecessor-version":[{"id":1692,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/pages\/24\/revisions\/1692"}],"wp:attachment":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=24"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=24"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}