<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://www.cpwiki.net/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.cpwiki.net/index.php?action=history&amp;feed=atom&amp;title=snmp-extend_to_run_custom_script</id>
		<title>snmp-extend to run custom script - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.cpwiki.net/index.php?action=history&amp;feed=atom&amp;title=snmp-extend_to_run_custom_script"/>
		<link rel="alternate" type="text/html" href="http://www.cpwiki.net/index.php?title=snmp-extend_to_run_custom_script&amp;action=history"/>
		<updated>2026-04-29T09:55:32Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.21.10</generator>

	<entry>
		<id>http://www.cpwiki.net/index.php?title=snmp-extend_to_run_custom_script&amp;diff=862&amp;oldid=prev</id>
		<title>Nighthawk at 02:31, 21 April 2021</title>
		<link rel="alternate" type="text/html" href="http://www.cpwiki.net/index.php?title=snmp-extend_to_run_custom_script&amp;diff=862&amp;oldid=prev"/>
				<updated>2021-04-21T02:31:00Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 02:31, 21 April 2021&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;br&amp;gt;STATUS: NOT OK!&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;br&amp;gt;STATUS: NOT OK!&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;2) Create entry in the SNMP config to &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;monitor &lt;/del&gt;the script:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;2) Create entry in the SNMP config to the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;monitor &lt;/ins&gt;script:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; # vi /etc/snmp/userDefinedSettings.conf&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; # vi /etc/snmp/userDefinedSettings.conf&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Nighthawk</name></author>	</entry>

	<entry>
		<id>http://www.cpwiki.net/index.php?title=snmp-extend_to_run_custom_script&amp;diff=850&amp;oldid=prev</id>
		<title>Nighthawk: Created page with &quot;1) Create a script/command that monitors something on your system and output the result to stdout.  &lt;br&gt;example  &lt;br&gt;script: /usr/local/bin/check_everything.sh &lt;br&gt;outputs eit...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.cpwiki.net/index.php?title=snmp-extend_to_run_custom_script&amp;diff=850&amp;oldid=prev"/>
				<updated>2021-02-24T12:42:42Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;1) Create a script/command that monitors something on your system and output the result to stdout.  &amp;lt;br&amp;gt;example  &amp;lt;br&amp;gt;script: /usr/local/bin/check_everything.sh &amp;lt;br&amp;gt;outputs eit...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;1) Create a script/command that monitors something on your system and output the result to stdout. &lt;br /&gt;
&amp;lt;br&amp;gt;example &lt;br /&gt;
&amp;lt;br&amp;gt;script: /usr/local/bin/check_everything.sh&lt;br /&gt;
&amp;lt;br&amp;gt;outputs either...&lt;br /&gt;
&amp;lt;br&amp;gt;STATUS: OK - everything good&lt;br /&gt;
&amp;lt;br&amp;gt;or&lt;br /&gt;
&amp;lt;br&amp;gt;STATUS: NOT OK!&lt;br /&gt;
&lt;br /&gt;
2) Create entry in the SNMP config to monitor the script:&lt;br /&gt;
 # vi /etc/snmp/userDefinedSettings.conf&lt;br /&gt;
&lt;br /&gt;
add a line...&lt;br /&gt;
 extend everything_status /bin/sh /usr/local/bin/check_everything.sh&lt;br /&gt;
&lt;br /&gt;
3) restart snmpd&lt;br /&gt;
 from clish, run &amp;quot;set snmp agent off&amp;quot; then run &amp;quot;set snmp agent on&amp;quot;&lt;br /&gt;
&lt;br /&gt;
4) test it &lt;br /&gt;
&lt;br /&gt;
with a walk&lt;br /&gt;
&lt;br /&gt;
 $ snmpwalk -On -v2c -c mycomstring 192.168.1.1 NET-SNMP-EXTEND-MIB::nsExtendObjects&lt;br /&gt;
 .1.3.6.1.4.1.8072.1.3.2.1.0 = INTEGER: 1&lt;br /&gt;
 .1.3.6.1.4.1.8072.1.3.2.2.1.2.15.102.119.112.111.108.105.99.121.95.115.116.97.116.117.115 = STRING: /bin/sh&lt;br /&gt;
 .1.3.6.1.4.1.8072.1.3.2.2.1.3.15.102.119.112.111.108.105.99.121.95.115.116.97.116.117.115 = STRING: &lt;br /&gt;
 /usr/local/bin/check_everything.sh&lt;br /&gt;
 .1.3.6.1.4.1.8072.1.3.2.2.1.4.15.102.119.112.111.108.105.99.121.95.115.116.97.116.117.115 = STRING: &lt;br /&gt;
 .1.3.6.1.4.1.8072.1.3.2.2.1.5.15.102.119.112.111.108.105.99.121.95.115.116.97.116.117.115 = INTEGER: 5&lt;br /&gt;
 .1.3.6.1.4.1.8072.1.3.2.2.1.6.15.102.119.112.111.108.105.99.121.95.115.116.97.116.117.115 = INTEGER: exec(1)&lt;br /&gt;
 .1.3.6.1.4.1.8072.1.3.2.2.1.7.15.102.119.112.111.108.105.99.121.95.115.116.97.116.117.115 = INTEGER: run-on-read(1)&lt;br /&gt;
 .1.3.6.1.4.1.8072.1.3.2.2.1.20.15.102.119.112.111.108.105.99.121.95.115.116.97.116.117.115 = INTEGER: permanent(4)&lt;br /&gt;
 .1.3.6.1.4.1.8072.1.3.2.2.1.21.15.102.119.112.111.108.105.99.121.95.115.116.97.116.117.115 = INTEGER: active(1)&lt;br /&gt;
 .1.3.6.1.4.1.8072.1.3.2.3.1.1.15.102.119.112.111.108.105.99.121.95.115.116.97.116.117.115 = STRING: STATUS: OK - everything good&lt;br /&gt;
 .1.3.6.1.4.1.8072.1.3.2.3.1.2.15.102.119.112.111.108.105.99.121.95.115.116.97.116.117.115 = STRING: STATUS: OK - everything good&lt;br /&gt;
 .1.3.6.1.4.1.8072.1.3.2.3.1.3.15.102.119.112.111.108.105.99.121.95.115.116.97.116.117.115 = INTEGER: 1&lt;br /&gt;
 .1.3.6.1.4.1.8072.1.3.2.3.1.4.15.102.119.112.111.108.105.99.121.95.115.116.97.116.117.115 = INTEGER: 0&lt;br /&gt;
 .1.3.6.1.4.1.8072.1.3.2.4.1.2.15.102.119.112.111.108.105.99.121.95.115.116.97.116.117.115.1 = STRING: STATUS: OK - everything good&lt;br /&gt;
&lt;br /&gt;
with a get&lt;br /&gt;
&lt;br /&gt;
 $ snmpget -v 2c -c mycomstring 192.168.1.1 &lt;br /&gt;
 .1.3.6.1.4.1.8072.1.3.2.4.1.2.15.102.119.112.111.108.105.99.121.95.115.116.97.116.117.115.1&lt;br /&gt;
 NET-SNMP-EXTEND-MIB::nsExtendOutLine.&amp;quot;fwpolicy_status&amp;quot;.1 = STRING: STATUS: OK - everything good&lt;/div&gt;</summary>
		<author><name>Nighthawk</name></author>	</entry>

	</feed>