This is a discussion on extend script to gather host data within the SNMP Users forums, part of the Networking and Network Related category; This is a multi-part message in MIME format. --===============2026822420== Content-Type: multipart/alternative; boundary="------------010403010607090205050406" This is ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
This is a multi-part message in MIME format.
--===============2026822420== Content-Type: multipart/alternative; boundary="------------010403010607090205050406" This is a multi-part message in MIME format. --------------010403010607090205050406 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I'm attempting to add a script to be called from SNMPd, but I'm looking for some additional information. I've written a script that currently outputs data as follows: jofficer@vm3 ~/bin $ ./var-snmp.sh agetty app1:agetty pid: 7182 cpu: 0.0 mem: 0.0 totalmem: 16314328 app2:agetty pid: 7184 cpu: 0.0 mem: 0.0 totalmem: 16314328 app3:agetty pid: 7185 cpu: 0.0 mem: 0.0 <--- truncated ---> I can modify the script as needed, but thats what I've got thus far. I run the script, and pass an argument on which process name I want information back for. The argument can be hard-coded, but for this example I'll leave it in place. I've modified snmpd.conf to show the following: extend .1.3.6.1.4.1.2021.55 showstat /bin/sh /tmp/var-snmp.sh agetty and when I walk it, I get the following output: UCD-SNMP-MIB::ucdavis.55.1.0 = INTEGER: 1 UCD-SNMP-MIB::ucdavis.55.2.1.2.8.115.104.111.119.115.116.97 .116 = STRING: "/bin/sh" UCD-SNMP-MIB::ucdavis.55.2.1.3.8.115.104.111.119.115.116.97 .116 = STRING: "/tmp/var-cmd.sh agetty" UCD-SNMP-MIB::ucdavis.55.2.1.4.8.115.104.111.119.115.116.97 .116 = "" UCD-SNMP-MIB::ucdavis.55.2.1.5.8.115.104.111.119.115.116.97 .116 = INTEGER: 5 UCD-SNMP-MIB::ucdavis.55.2.1.6.8.115.104.111.119.115.116.97 .116 = INTEGER: 1 UCD-SNMP-MIB::ucdavis.55.2.1.7.8.115.104.111.119.115.116.97 .116 = INTEGER: 1 UCD-SNMP-MIB::ucdavis.55.2.1.20.8.115.104.111.119.115.116.9 7.116 = INTEGER: 4 UCD-SNMP-MIB::ucdavis.55.2.1.21.8.115.104.111.119.115.116.9 7.116 = INTEGER: 1 UCD-SNMP-MIB::ucdavis.55.3.1.1.8.115.104.111.119.115.116.97 .116 = STRING: "app1:agetty" UCD-SNMP-MIB::ucdavis.55.3.1.2.8.115.104.111.119.115.116.97 .116 = STRING: "app1:agetty pid: 7182 cpu: 0.0 mem: 0.0 totalmem: 16314328 app2:agetty pid: 7184 cpu: 0.0 mem: 0.0 totalmem: 16314328 UCD-SNMP-MIB::ucdavis.55.3.1.3.8.115.104.111.119.115.116.97 .116 = INTEGER: 30 UCD-SNMP-MIB::ucdavis.55.3.1.4.8.115.104.111.119.115.116.97 .116 = INTEGER: 0 UCD-SNMP-MIB::ucdavis.55.4.1.2.8.115.104.111.119.115.116.97 .116.1 = STRING: "app1:agetty" UCD-SNMP-MIB::ucdavis.55.4.1.2.8.115.104.111.119.115.116.97 .116.2 = STRING: "pid: 7182" UCD-SNMP-MIB::ucdavis.55.4.1.2.8.115.104.111.119.115.116.97 .116.3 = STRING: "cpu: 0.0" UCD-SNMP-MIB::ucdavis.55.4.1.2.8.115.104.111.119.115.116.97 .116.4 = STRING: "mem: 0.0" UCD-SNMP-MIB::ucdavis.55.4.1.2.8.115.104.111.119.115.116.97 .116.5 = STRING: "totalmem: 16314328" UCD-SNMP-MIB::ucdavis.55.4.1.2.8.115.104.111.119.115.116.97 .116.6 = STRING: "app2:agetty" UCD-SNMP-MIB::ucdavis.55.4.1.2.8.115.104.111.119.115.116.97 .116.7 = STRING: "pid: 7184" UCD-SNMP-MIB::ucdavis.55.4.1.2.8.115.104.111.119.115.116.97 .116.8 = STRING: "cpu: 0.0" UCD-SNMP-MIB::ucdavis.55.4.1.2.8.115.104.111.119.115.116.97 .116.9 = STRING: "mem: 0.0" UCD-SNMP-MIB::ucdavis.55.4.1.2.8.115.104.111.119.115.116.97 .116.10 = STRING: "totalmem: 16314328" <---truncated---> A couple of things. 1. I know I need to if this is the best way to provide output, and whether or not I should include the individual field name within the result (ie cpu: 0.0 or just 0.0 ). 2. UCD-SNMP-MIB::ucdavis.55.3.1.3.8.115.104.111.119.115.116.97 .116 = INTEGER: 30 -- I assume this means I have 30 lines to output. Is there a way to provide either an index, or ??? , to tell an end user that the 5 lines should be grouped to give one full data set. * Kinda like eth0.In and eth0.Out 3. Once I get this part completed, what is the best way to build an MIB for release so that others could use this. This is sample data, but the end script would be more useful to more people than myself. some info: vm3 tmp # snmpwalk --version NET-SNMP version: 5.4.1 Thanks, joey -- Joey Officer Systems Administrator iStream Imaging 262-432-1536 CONFIDENTIALITY NOTICE This electronic mail and the information contained herein are intended for the named recipient only. It may contain confidential, proprietary and/or privileged information. If you have received this electronic mail in error, please do not read any text other than the text of this notice and do not open any attachments. Also, please immediately notify the sender by replying to this electronic mail or by collect call to (262) 796-0925. After notifying the sender as described above, please delete this electronic mail message immediately and purge the item from the deleted items folder (or the equivalent) of your electronic mail system. Thank you. --------------010403010607090205050406 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> </head> <body bgcolor="#ffffff" text="#000000"> I'm attempting to add a script to be called from SNMPd, but I'm looking for some additional information. I've written a script that currently outputs data as follows:<br> <br> jofficer@vm3 ~/bin $ ./var-snmp.sh agetty<br> app1:agetty<br> pid: 7182<br> cpu: 0.0<br> mem: 0.0<br> totalmem: 16314328<br> app2:agetty<br> pid: 7184<br> cpu: 0.0<br> mem: 0.0<br> totalmem: 16314328<br> app3:agetty<br> pid: 7185<br> cpu: 0.0<br> mem: 0.0<br> <--- truncated ---><br> <br> I can modify the script as needed, but thats what I've got thus far. I run the script, and pass an argument on which process name I want information back for. The argument can be hard-coded, but for this example I'll leave it in place.<br> <br> I've modified snmpd.conf to show the following:<br> <br> extend .1.3.6.1.4.1.2021.55 showstat /bin/sh /tmp/var-snmp.sh agetty<br> <br> and when I walk it, I get the following output:<br> <br> UCD-SNMP-MIB::ucdavis.55.1.0 = INTEGER: 1<br> UCD-SNMP-MIB::ucdavis.55.2.1.2.8.115.104.111.119.115.116.97 .116 = STRING: "/bin/sh"<br> UCD-SNMP-MIB::ucdavis.55.2.1.3.8.115.104.111.119.115.116.97 .116 = STRING: "/tmp/var-cmd.sh agetty"<br> UCD-SNMP-MIB::ucdavis.55.2.1.4.8.115.104.111.119.115.116.97 .116 = ""<br> UCD-SNMP-MIB::ucdavis.55.2.1.5.8.115.104.111.119.115.116.97 .116 = INTEGER: 5<br> UCD-SNMP-MIB::ucdavis.55.2.1.6.8.115.104.111.119.115.116.97 .116 = INTEGER: 1<br> UCD-SNMP-MIB::ucdavis.55.2.1.7.8.115.104.111.119.115.116.97 .116 = INTEGER: 1<br> UCD-SNMP-MIB::ucdavis.55.2.1.20.8.115.104.111.119.115.116.9 7.116 = INTEGER: 4<br> UCD-SNMP-MIB::ucdavis.55.2.1.21.8.115.104.111.119.115.116.9 7.116 = INTEGER: 1<br> UCD-SNMP-MIB::ucdavis.55.3.1.1.8.115.104.111.119.115.116.97 .116 = STRING: "app1:agetty"<br> UCD-SNMP-MIB::ucdavis.55.3.1.2.8.115.104.111.119.115.116.97 .116 = STRING: "app1:agetty<br> pid: 7182<br> cpu: 0.0<br> mem: 0.0<br> totalmem: 16314328<br> app2:agetty<br> pid: 7184<br> cpu: 0.0<br> mem: 0.0<br> totalmem: 16314328<br> UCD-SNMP-MIB::ucdavis.55.3.1.3.8.115.104.111.119.115.116.97 .116 = INTEGER: 30<br> UCD-SNMP-MIB::ucdavis.55.3.1.4.8.115.104.111.119.115.116.97 .116 = INTEGER: 0<br> UCD-SNMP-MIB::ucdavis.55.4.1.2.8.115.104.111.119.115.116.97 .116.1 = STRING: "app1:agetty"<br> UCD-SNMP-MIB::ucdavis.55.4.1.2.8.115.104.111.119.115.116.97 .116.2 = STRING: "pid: 7182"<br> UCD-SNMP-MIB::ucdavis.55.4.1.2.8.115.104.111.119.115.116.97 .116.3 = STRING: "cpu: 0.0"<br> UCD-SNMP-MIB::ucdavis.55.4.1.2.8.115.104.111.119.115.116.97 .116.4 = STRING: "mem: 0.0"<br> UCD-SNMP-MIB::ucdavis.55.4.1.2.8.115.104.111.119.115.116.97 .116.5 = STRING: "totalmem: 16314328"<br> UCD-SNMP-MIB::ucdavis.55.4.1.2.8.115.104.111.119.115.116.97 .116.6 = STRING: "app2:agetty"<br> UCD-SNMP-MIB::ucdavis.55.4.1.2.8.115.104.111.119.115.116.97 .116.7 = STRING: "pid: 7184"<br> UCD-SNMP-MIB::ucdavis.55.4.1.2.8.115.104.111.119.115.116.97 .116.8 = STRING: "cpu: 0.0"<br> UCD-SNMP-MIB::ucdavis.55.4.1.2.8.115.104.111.119.115.116.97 .116.9 = STRING: "mem: 0.0"<br> UCD-SNMP-MIB::ucdavis.55.4.1.2.8.115.104.111.119.115.116.97 .116.10 = STRING: "totalmem: 16314328"<br> <---truncated---><br> <br> A couple of things.<br> <br> <ol> <li>I know I need to if this is the best way to provide output, and whether or not I should include the individual field name within the result (ie cpu: 0.0 or just 0.0 ).</li> <li>UCD-SNMP-MIB::ucdavis.55.3.1.3.8.115.104.111.119.115.116.97 .116 = INTEGER: 30 -- I assume this means I have 30 lines to output. Is there a way to provide either an index, or ??? , to tell an end user that the 5 lines should be grouped to give one full data set.</li> <ul> <li>Kinda like eth0.In and eth0.Out</li> </ul> <li>Once I get this part completed, what is the best way to build an MIB for release so that others could use this. This is sample data, but the end script would be more useful to more people than myself.</li> </ol> some info:<br> vm3 tmp # snmpwalk --version<br> NET-SNMP version: 5.4.1<br> <br> Thanks,<br> joey<br> <br> <br> <pre class="moz-signature" cols="72">-- Joey Officer Systems Administrator iStream Imaging 262-432-1536 CONFIDENTIALITY NOTICE This electronic mail and the information contained herein are intended for the named recipient only. It may contain confidential, proprietary and/or privileged information. If you have received this electronic mail in error, please do not read any text other than the text of this notice and do not open any attachments. Also, please immediately notify the sender by replying to this electronic mail or by collect call to (262) 796-0925. After notifying the sender as described above, please delete this electronic mail message immediately and purge the item from the deleted items folder (or the equivalent) of your electronic mail system. Thank you. </pre> </body> </html> --------------010403010607090205050406-- --===============2026822420== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ --===============2026822420== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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/...net-snmp-users --===============2026822420==-- |