Re: bash script - extend - output as integer

Paul Herring <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <CAEWO_9T7Kkk=X7KAz2TSrxmX_O-g1qF516vt_c-pKVViJpUJXw@mail.gmail.com>
https://docs.fedoraproject.org/en-US/Fedora/18/html/System_Administrators_Guide/sect-System_Monitoring_Tools-Net-SNMP-Extending.html

> Note that the exit code (“8” in this example) is provided as an INTEGER
type and any output is provided as a STRING type.

You want get_TempOfRoom1.sh to exit (the return code) with the value you
want in the INTEGER, not echo it out.

On Tue, Apr 21, 2020 at 1:56 PM Dennis Schneck <[email protected]> wrote:

>
> Hello,
> how to get an integer value from a bash script if using "extend" in
> /etc/snmp/snmpd.conf ?
>
> extend TempOfRoom1 /scripts/get_TempOfRoom1.sh
>
> got only STRING but no INTEGER
>
>
> NET-SNMP-EXTEND-MIB::nsExtendOutput1Line."TempOfRoom1" = STRING: 2210
>
>
> like to get:
>
> NET-SNMP-EXTEND-MIB::nsExtendResult."TempOfRoom1" = INTEGER: 2210 insted
> of "NET-SNMP-EXTEND-MIB::nsExtendOutput1Line."TempOfRoom1" = STRING: 2210"
>
> Thanks
>
> _______________________________________________
> 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
>


-- 
PJH

_______________________________________________
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.