Re: passing parameters to a perl script through snmpd
Jordi Moles <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Hi, there's no way. i don't thing there's nothing wrong with the call i'm permorming, is there? ARGV[0] is -s ARGV[1] is .1.3.6.1.4.1.2021.255.8.1.8 and finally ARGV[2] is string and nothing else is passed. do you think there is some perl package missing? Could anyone try this easy example? Maybe i'm missing something really stupid. Just put a line like this in the smtpd.conf pass .1.3.6.1.4.1.2021.255 /root/script.pl and then.. in the script.pl, something like *********** #!/usr/bin/perl `echo $ARGV[0] > /root/output.txt`; `echo $ARGV[1] >> /root/output.txt`; `echo $ARGV[2] >> /root/output.txt`; `echo $ARGV[3] >> /root/output.txt`; `echo $ARGV[4] >> /root/output.txt`; `echo $ARGV[5] >> /root/output.txt`; ************ in my case, only $ARGV[0], [1] and [2] has a proper value. Thank you. En/na Dave Shield ha escrit: > On 12/02/2008, Jordi Moles <[email protected]> wrote: > >> i guess that from the perl script, i have to catch values with $ARGV >> > > Correct > > >> when i do: >> >> *********** >> snmpset -v 2c -c cdpublicmon localhost .1.3.6.1.4.1.2021.255.8.1.8 s "hi" >> *********** >> >> what perl receives is something like this: >> >> ********* >> -s >> .1.3.6.1.4.1.2021.255.8.1.8 >> string >> ********* >> > > It should receive > > -s > .1.3.6.1.4.1.2021.255.8.1.8 > string > hi > > Dave > > ------------------------------------------------------------------------- > 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 > [email protected] > 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: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Net-snmp-users mailing list [email protected] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users