how to modify the output of an smpset command

This is a discussion on how to modify the output of an smpset command within the SNMP Users forums, part of the Networking and Network Related category; hi, i'm using perl to extend the functionality of snmp. i'm doing something like this from the perl ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-12-2008
Jordi Moles
 
Posts: n/a
Default how to modify the output of an smpset command

hi,

i'm using perl to extend the functionality of snmp.

i'm doing something like this from the perl script to handle snmpset
commands:


**************

if ( $ARGV[0] eq "-s")
{

$oid = $ARGV[1];
$tot = $ARGV[3];
@parts = split(/\.\.\./, $tot);

if ( ($parts[0] eq "delete") && ($oid eq
".1.3.6.1.4.1.2021.255.8.1.9") )
{
`/bin/rm -rf /mnt/gluster/$parts[1]`;
$sortida = system("/bin/ls -alis /mnt/gluster |
/bin/grep $parts[1]");
if($sortida==256)
{
print "ok"; ##tot ok
}
else { print "not-writable"; } ##ha fallat
exit 0;
}
}



**************

The thing is that if i run this command:

********
snmpset -v 2c -c mykey localhost .1.3.6.1.4.1.2021.255.8.1.9 s
"delete...bustia01"
********


i get this in the shell.......

********
UCD-SNMP-MIB::ucdavis.255.8.1.2 = STRING: "delete...bustia01"
********


so... what i would like to do is replacing this "STRING:
"delete...bustia01" witch something else dynamically, let's say a value
that is calculated within the if

if ( ($parts[0] eq "delete") && ($oid eq ".1.3.6.1.4.1.2021.255.8.1.9") )



has anyone succeeded in doing this?

Thank you.

-------------------------------------------------------------------------
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/
_______________________________________________
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
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:57 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0