Hi
Is it possible to allow args for perl do?
At the present moment, it seems like a correct way to document ones snmpd.conf with a visible showing of $regat
Best regards,
Owen Brotherwood
See extended example in:
http://www.net-snmp.org/wiki/index.php/Tut:Extending_snmpd_using_perl
Logged In: YES
user_id=1896547
Originator: YES
The example in wiki works well enough for there not to be any reason to bother about argv etc ...
Logged In: YES
user_id=1896547
Originator: YES
except for problem that only one of these will work ...
perl print STDERR "Perl extentsions:\n"
perl $regat = '.1.3.6.1.4.1.8072.998'; $mibdata = '/etc/passwd'; $delimT=''; $delimV=':'; do "/etc/snmp/myext.pl";
perl $regat = '.1.3.6.1.4.1.8072.999'; $mibdata = '/etc/group'; $delimT=''; $delimV=':'; do "/etc/snmp/myext.pl";
Logged In: YES
user_id=1896547
Originator: YES
I need a "ping" to complete:
http://forums.cacti.net/viewtopic.php?p=111649#111649
Logged In: YES
user_id=88893
Originator: NO
In answer to the original question:
No - it is not possible for "do FILE;" to take arguments.
This is not a restriction of the Net-SNMP code - it is
inherent in the behaviour of this particular perl statement.
If you check the relevant perl documentation
(e.g. http://perldoc.perl.org/functions/do.html\)
you'll see that "do" takes a single argument,
specifying the name of the file to execute.
We can't change this behaviour ourselves - you would
need to persuade the Perl developers to make such a change.