Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Net-SNMP v5.4.1 extend question

7 views
Skip to first unread message

Lean Cornelius

unread,
May 22, 2008, 5:23:56 AM5/22/08
to
Hi all,

I have been pounding my head against a wall the past 24 hours and need
some help.
I use SNMP to call scripts on my linux server and then receive the
output from the script.

After upgrading to Net-SNMP v5.4.1 yesterday everything stopped working.
I now understand that I should not use "exec" anymore, but "extend" instead.
This is working now, but why is Net-SNMP adding so many values to my OID?

Here are an example of my output before Net-SNMP v5.4.1 using exec:

snmpd.conf:
exec .1.3.6.1.4.1.2021.900.50.2.2 SAR510Info
/usr/local/lean/Net-SNMP-Linux.pl 2

lean@inflames:~$ snmpwalk -v1 10.10.1.103 -c testing
.1.3.6.1.4.1.2021.900.50.2.2
UCD-SNMP-MIB::ucdavis.900.50.2.2.1.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.900.50.2.2.2.1 = STRING: "SAR510Info"
UCD-SNMP-MIB::ucdavis.900.50.2.2.3.1 = STRING:
"/usr/local/lean/Net-SNMP-Linux.pl 2"
UCD-SNMP-MIB::ucdavis.900.50.2.2.100.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.900.50.2.2.101.1 = STRING: "::::::::::::::"
UCD-SNMP-MIB::ucdavis.900.50.2.2.101.2 = STRING:
"/usr/local/lean/var/spool/sar510Info.txt"
UCD-SNMP-MIB::ucdavis.900.50.2.2.101.3 = STRING: "::::::::::::::"
UCD-SNMP-MIB::ucdavis.900.50.2.2.101.4 = STRING: "0.00"
UCD-SNMP-MIB::ucdavis.900.50.2.2.101.5 = STRING: "0.00"
UCD-SNMP-MIB::ucdavis.900.50.2.2.101.6 = STRING: "0.36"
UCD-SNMP-MIB::ucdavis.900.50.2.2.101.7 = STRING: "99.62"
UCD-SNMP-MIB::ucdavis.900.50.2.2.102.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.900.50.2.2.103.1 = ""

Here are an example of my output using Net-SNMP v5.4.1 with extend:

snmpd.conf:
extend .1.3.6.1.4.1.2021.900.50.2.2 SAR510Info
/usr/local/lean/Net-SNMP-Linux.pl 2

lean@inflames:~$ snmpwalk -v1 10.1.1.86 -c testing
.1.3.6.1.4.1.2021.900.50.2.2.4
UCD-SNMP-MIB::ucdavis.900.50.2.2.4.1.2.10.83.65.82.53.49.48.73.110.102.111.1
= STRING: "::::::::::::::"
UCD-SNMP-MIB::ucdavis.900.50.2.2.4.1.2.10.83.65.82.53.49.48.73.110.102.111.2
= STRING: "/usr/local/sintrex/var/spool/sar510Info.txt"
UCD-SNMP-MIB::ucdavis.900.50.2.2.4.1.2.10.83.65.82.53.49.48.73.110.102.111.3
= STRING: "::::::::::::::"
UCD-SNMP-MIB::ucdavis.900.50.2.2.4.1.2.10.83.65.82.53.49.48.73.110.102.111.4
= STRING: "0.00"
UCD-SNMP-MIB::ucdavis.900.50.2.2.4.1.2.10.83.65.82.53.49.48.73.110.102.111.5
= STRING: "0.00"
UCD-SNMP-MIB::ucdavis.900.50.2.2.4.1.2.10.83.65.82.53.49.48.73.110.102.111.6
= STRING: "0.18"
UCD-SNMP-MIB::ucdavis.900.50.2.2.4.1.2.10.83.65.82.53.49.48.73.110.102.111.7
= STRING: "99.78"

I have figured out that by assigning a .4 at the end of my OID I get
less garbage.

Now my question is as follows:

What are all those values after my OID that I specified
(.1.2.10.83.65.82.53.49.48.73.110.102.111)?

Kind regards,
Lean Cornelius

-------------------------------------------------------------------------
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-coders mailing list
Net-snm...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Dave Shield

unread,
May 22, 2008, 6:02:00 AM5/22/08
to
2008/5/22 Lean Cornelius <lean.co...@sintrex.com>:

> After upgrading to Net-SNMP v5.4.1 yesterday everything stopped working.
> I now understand that I should not use "exec" anymore, but "extend" instead.
> This is working now, but why is Net-SNMP adding so many values to my OID?

The MIB structure used for the "extend" output is not the same as
that for the old "exec" directive. If nothing else, it is now a valid MIB
structure, which the old format was not!

See NET-SNMP-EXTEND-MIB for the structure of this output.
The same structure is used for your output - just rooted at
the OID that you specify.


> I have figured out that by assigning a .4 at the end of my OID I get
> less garbage.

That is nsExtendOutput2Table - i.e. the output, one line at a time.

> Now my question is as follows:
>
> What are all those values after my OID that I specified
> (.1.2.10.83.65.82.53.49.48.73.110.102.111)?

.1.2 specify the nsExtendOutLine object (or your equivalent)

10.83.65.82.53.49.48.73.110.102.111 is the string index of this entry
This translates to "SAR510Info" - i.e. the name you specified
in the "extend" directive.


You might find it helpful to take a copy of the NET-SNMP-EXTEND-MIB file,
change the name of the MIB to something different, and tweak the
"nsExtendObjects" OID to match your registration OID.
If you then load this MIB file as usual, you should find that the
output is displayed in a more meaningful manner.

Dave

Dave Shield

unread,
May 22, 2008, 9:22:06 AM5/22/08
to
[ First - *please* don't mail me privately, without copying
any responses to the mailing list. I don't have the time
or inclination to offer private, unpaid, SNMP consultancy.
Keep discussions to the list, where others can both learn
and offer advice. Thanks. ]

2008/5/22 Lean Cornelius <lean.co...@sintrex.com>:
> Now I'm really confused!
>
> I adjusted my script that call the OID to get the required values. Works
> perfect again.
> I just installed a new server with Net-SNMP v5.4.1 (Both servers running
> ubuntu server 64bit).
>
> Output server1:
> snmpd.conf:
> extend .1.3.6.1.4.1.2021.900.50.2.2 SAR510Info
> /usr/local/lean/bin/Net-SNMP-Linux.pl 2


>
> lean@inflames:~$ snmpwalk -v1 10.1.1.86 -c testing
> .1.3.6.1.4.1.2021.900.50.2.2.4

> UCD-SNMP-MIB::ucdavis.900.50.2.2.4.1.2.12.83.83.83.65.82.53.49.48.73.110.102.111.1
> = STRING: "::::::::::::::"
> UCD-SNMP-MIB::ucdavis.900.50.2.2.4.1.2.12.83.83.83.65.82.53.49.48.73.110.102.111.2
> = STRING: "/usr/local/lean/var/spool/sar510Info.txt"
> UCD-SNMP-MIB::ucdavis.900.50.2.2.4.1.2.12.83.83.83.65.82.53.49.48.73.110.102.111.3
> = STRING: "::::::::::::::"
> UCD-SNMP-MIB::ucdavis.900.50.2.2.4.1.2.12.83.83.83.65.82.53.49.48.73.110.102.111.4
> = STRING: "0.04"
> UCD-SNMP-MIB::ucdavis.900.50.2.2.4.1.2.12.83.83.83.65.82.53.49.48.73.110.102.111.5
> = STRING: "0.00"
> UCD-SNMP-MIB::ucdavis.900.50.2.2.4.1.2.12.83.83.83.65.82.53.49.48.73.110.102.111.6
> = STRING: "0.26"
> UCD-SNMP-MIB::ucdavis.900.50.2.2.4.1.2.12.83.83.83.65.82.53.49.48.73.110.102.111.7
> = STRING: "99.58"
>
> This makes perfect sense as you explained to me.
>
> Output server2:
>
> snmpd.conf:
> extend .1.3.6.1.4.1.2021.900.50.2.2 SAR510Info
> /usr/local/lean/bin/Net-SNMP-Linux.pl 2
>
> lean@inflames:~$ snmpwalk -v1 10.1.1.87 -c testing


> .1.3.6.1.4.1.2021.900.50.2.2.4
> UCD-SNMP-MIB::ucdavis.900.50.2.2.4.1.2.10.83.65.82.53.49.48.73.110.102.111.1
> = STRING: "::::::::::::::"
> UCD-SNMP-MIB::ucdavis.900.50.2.2.4.1.2.10.83.65.82.53.49.48.73.110.102.111.2

> = STRING: "/usr/local/lean/var/spool/sar510Info.txt"


> UCD-SNMP-MIB::ucdavis.900.50.2.2.4.1.2.10.83.65.82.53.49.48.73.110.102.111.3
> = STRING: "::::::::::::::"
> UCD-SNMP-MIB::ucdavis.900.50.2.2.4.1.2.10.83.65.82.53.49.48.73.110.102.111.4

> = STRING: "7.46"


> UCD-SNMP-MIB::ucdavis.900.50.2.2.4.1.2.10.83.65.82.53.49.48.73.110.102.111.5
> = STRING: "0.00"
> UCD-SNMP-MIB::ucdavis.900.50.2.2.4.1.2.10.83.65.82.53.49.48.73.110.102.111.6

> = STRING: "4.18"
> UCD-SNMP-MIB::ucdavis.900.50.2.2.4.1.2.10.83.65.82.53.49.48.73.110.102.111.7
> = STRING: "88.30"
>
> This is the confusing part, the OID's for the same value changed!
>
> Server1
> UCD-SNMP-MIB::ucdavis.900.50.2.2.4.1.2.12.83.83.83.65.82.53.49.48.73.110.102.111.7
> = STRING: "99.58"
> Server2
> UCD-SNMP-MIB::ucdavis.900.50.2.2.4.1.2.10.83.65.82.53.49.48.73.110.102.111.7
> = STRING: "88.30"
>
> Could you please shed more light on this one?


Looking at those last two lines, the first server is using indexes of the form
12.83.83.83.65.82.53.49.48.73.110.102.111
while the second is using
10.83.65.82.53.49.48.73.110.102.111

These correspond to "SSSAR510Info" and "SAR510Info" respectively.
So it's actually the first server which is broken.

I'm not sure what's going wrong here, but:

a) double-check that you've got exactly the same snmpd.conf
settings on both machines.
b) try deleting and re-typing the entry on the first server

c) it might be worth trying with 5.4.2.pre1 on that system, just in
case there's a subtle problem that's biting you which has since been fixed.
(Though I'd expect this to hit both systems in the same way).

Lean Cornelius

unread,
May 22, 2008, 9:31:25 AM5/22/08
to
Hi Dave,

My apologies, I did not realize that I was hitting the reply button and
not the reply to all.
I think I should call it a day since sleep is something I haven't had
for a few days.

Thanks, your last post resolved my issue.!
I should learn to restart my SNMP after changing SSAR510Info to SAR510Info.

Regards,
Lean

0 new messages