

<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://net-snmp.sourceforge.io/wiki/index.php?action=history&amp;feed=atom&amp;title=Watcher</id>
		<title>Watcher - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://net-snmp.sourceforge.io/wiki/index.php?action=history&amp;feed=atom&amp;title=Watcher"/>
		<link rel="alternate" type="text/html" href="https://net-snmp.sourceforge.io/wiki/index.php?title=Watcher&amp;action=history"/>
		<updated>2026-04-07T23:02:49Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.3</generator>

	<entry>
		<id>https://net-snmp.sourceforge.io/wiki/index.php?title=Watcher&amp;diff=5273&amp;oldid=prev</id>
		<title>Wes: Created page with &quot;{{helper|Watcher|code=agent/helpers/watcher.c|documentation=watcher}}  The &#039;&#039;&#039;watcher&#039;&#039;&#039; does what it&#039;s named: it watches variables and any time an incoming request is made for t...&quot;</title>
		<link rel="alternate" type="text/html" href="https://net-snmp.sourceforge.io/wiki/index.php?title=Watcher&amp;diff=5273&amp;oldid=prev"/>
				<updated>2011-07-20T22:50:04Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{helper|Watcher|code=agent/helpers/watcher.c|documentation=watcher}}  The &amp;#039;&amp;#039;&amp;#039;watcher&amp;#039;&amp;#039;&amp;#039; does what it&amp;#039;s named: it watches variables and any time an incoming request is made for t...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{helper|Watcher|code=agent/helpers/watcher.c|documentation=watcher}}&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;watcher&amp;#039;&amp;#039;&amp;#039; does what it&amp;#039;s named: it watches variables and any time an incoming request is made for the [[OID]] assigned to it, it returns the current value of the variable.  It is the absolute simplest way to tie a memory address to an OID with a single line of code.&lt;br /&gt;
&lt;br /&gt;
== Example Usage ==&lt;br /&gt;
&lt;br /&gt;
    static int my_int = 42;&lt;br /&gt;
    netsnmp_register_read_only_int_scalar(&amp;quot;myVariable&amp;quot;,&lt;br /&gt;
                                          my_oid,&lt;br /&gt;
                                          OID_LENGTH(my_oid),&lt;br /&gt;
                                          &amp;amp;my_int, NULL);&lt;br /&gt;
== Types Supported ==&lt;br /&gt;
&lt;br /&gt;
There are a number of scalar convenience functions that can be watched.&lt;br /&gt;
&lt;br /&gt;
  netsnmp_register_ulong_scalar( /* ... */ );&lt;br /&gt;
  netsnmp_register_read_only_ulong_scalar( /* ... */ );&lt;br /&gt;
  netsnmp_register_long_scalar( /* ... */ );&lt;br /&gt;
  netsnmp_register_read_only_long_scalar( /* ... */ );&lt;br /&gt;
  netsnmp_register_int_scalar( /* ... */ );&lt;br /&gt;
  netsnmp_register_read_only_int_scalar( /* ... */ );&lt;br /&gt;
  netsnmp_register_read_only_counter32_scalar( /* ... */ );&lt;br /&gt;
&lt;br /&gt;
The _read_only_ variants should be use if you don&amp;#039;t want to support [[SET]] operations to the value.&lt;/div&gt;</summary>
		<author><name>Wes</name></author>	</entry>

	</feed>