Re: passing parameters to a perl script through snmpd

Jordi Moles <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hi again,

i thought i was going somewhere, but i got stuck with the perl script.
How do i actually get the value in the perl script to be able to process 
it appropriately?

I mean, i guess that from the perl script, i have to catch values with $ARGV

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
*********

These all the values i get from the snmp calling the perl script.
The ".1.3.6.1.4.1.2021.255.8.1.8" is great, cause i could actually use 
and "if" to detect this call and execute something, but... what about the
value i'm setting.

I don't know if the problem is that i use "pass" and i should use 
another method.

Thank you.

En/na Jordi Moles ha escrit:
> Hi,
>
> thanks for the details, that was really helpful, i almost have i want to do.
>
> Thank you.
>
> En/na Dave Shield ha escrit:
>   
>> On 11/02/2008, Jordi Moles Blanco <[email protected]> wrote:
>>   
>>     
>>> pass    .1.3.6.1.4.1.2021.255    /home/monitor/tests/extensio.pl
>>>     
>>>       
>>   
>>     
>>> I would like to create .1.3.6.1.4.1.2021.255.8.1.8, which needs a var
>>> set during the execution time. Is that possible?
>>>     
>>>       
>> Yes.
>>
>> If you issue the command
>>
>>      snmpset ......   .1.3.6.1.4.1.2021.255.8.1.8 i 123
>>
>> (assuming that this MIB object is defined as an integer)
>> then your script will be called as
>>
>>     /home/monitor/tests/extensio.pl  -s  .1.3.6.1.4.1.2021.255.8.1.8 integer 123
>>
>> It's then up to your script to check that the OID, type and value
>> are OK, and accept or reject the request accordingly.
>>
>> See the section on the "pass" directive in the snmpd.conf(5)
>> man page for details.
>>
>> 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
>   


-------------------------------------------------------------------------
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.