On Mon, 16 Apr 2007, Dave Shield wrote: > On 13/04/07, Charles Sprickman <[EMAIL PROTECTED]> wrote: >> In snmpd.conf I have something like this: >> >> exec .1.3.6.1.4.1.2021.9100.1 QmailQueue1 /usr/local/adm/bin/qm-stat-cat.sh 1 >> exec .1.3.6.1.4.1.2021.9100.2 QmailQueue2 /usr/local/adm/bin/qm-stat-cat.sh 2 >> exec .1.3.6.1.4.1.2021.9100.3 QmailQueue3 /usr/local/adm/bin/qm-stat-cat.sh 3 >> >> It does work, but I'm totally lost on how to make sure these values, which >> are always integers are reported as such. > >> >> toolbox[~]# snmpwalk -v1 -c foo h07 1.3.6.1.4.1.2021.9100.1.101.8 >> UCD-SNMP-MIB::ucdavis.9100.1.101.8 = STRING: "0" > > The agent does not know what output will be produced by an arbitrary > command, so always reports it as a string. This means that MRTG, etc > cannot generate a graph from it.
Understood. > You'd need to adjust the 'qm-stat-cat' script to return the numeric > value as the *exit* status from the script, and then retrieve (and monitor) > the OID UCD-SNMP-MIB::ucdavis.9100.1.100 I'm a little fuzzy on that... Are you saying that normally exec will return a string if a script run via exec outputs anything to STDOUT, but that if the script just exits with an exit code an integer type will be returned? > Note that the MIB structure generated by > exec {OID} {NAME} .... > is not strictly legal, and this directive has been withdrawn as from release > 5.4 and above. Instead, you should use > extend {OID} {NAME} ..... > which generates a different (legal!) format for the results. So where possible I should use extend instead of exec basically? I'm not at all an snmp wizard, but this seemed like a simple way to monitor things remotely. Are there any good examples out there that detail some simple exec, extend or pass configurations? I've poked around in the docs and wiki, but didn't find any examples (sadly the only way I seem to learn properly). Thanks, Charles > Dave > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Net-snmp-users mailing list > Net-snmp-users@lists.sourceforge.net > Please see the following page to unsubscribe or change other options: > https://lists.sourceforge.net/lists/listinfo/net-snmp-users > > ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users