Leopard's SNMP Extensible sections (exec) not working

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Leopard's SNMP Extensible sections (exec) not working

Martin Capella
Extensible sections in Leopard's default SNMP (5.4.1) is broken. At least I can't get it to work. In SNMP 5.2.4 (which I compiled for Tiger server) it works. I don't want to have to compile a different version of snmp for Leopard, since for the most part the included default version works very well. 

The default snmpd.conf file (In leopard server) describes, with examples, how to set it up:

exec .1.3.6.1.4.1.2021.50 shelltest /bin/sh /tmp/shtest

I created the shtest script:

#!/bin/sh
 echo hello world
 echo hi there 
 exit 35

It works when I run it manually:

server: user$ /bin/sh /tmp/shtest
hello world
hi there

when I try to walk the OID I get nothing:

server:/ user$ snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.50
server:/ user$ 

or

server:/ user$ snmpwalk -v 2c -c public localhost .1.3.6.1.4.1.2021.50
UCD-SNMP-MIB::ucdavis.50 = No Such Object available on this agent at this OID

I use execs extensively in snmpd for monitoring all the included pmu, smu, smc sensors, and serveradmin commands in my mac servers (using cacti, marcel bresink's hwmonitor, and examples from Andre LaBranche's blog: http://www.dreness.com/blog/archives/33)

exec 1.3.6.1.4.1.2021.8.1.101 cpu /bin/cat /opt/net-snmp/data/cpu
exec 1.3.6.1.4.1.2021.8.2.101 temp /bin/cat /opt/net-snmp/data/temp
exec 1.3.6.1.4.1.2021.8.3.101 disk /bin/cat /opt/net-snmp/data/disk
exec 1.3.6.1.4.1.2021.8.4.101 mem /bin/cat /opt/net-snmp/data/mem

These entries read data from scripts that poll hwmonitor and serveradmin. They have become indispensable for monitoring my deployed tiger servers.
It would be great if I am just missing something in the config that can just be turned on. Otherwise snmp 5.4.1 in leopard server has a very annoying bug. I have exhausted my troubleshooting skills at this problem. If someone has any idea of what I may be doing wrong I would truly appreciate the help.

Thanks!

Martin.


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macos-x-server mailing list      ([hidden email])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macos-x-server/lists%40nabble.com

This email sent to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Leopard's SNMP Extensible sections (exec) not working

John C. Welch
Re: Leopard's SNMP Extensible sections (exec) not working On 5/12/08 2:40 PM, "Martin Capella" <[hidden email]> wrote:

Extensible sections in Leopard's default SNMP (5.4.1) is broken. At least I can't get it to work. In SNMP 5.2.4 (which I compiled for Tiger server) it works. I don't want to have to compile a different version of snmp for Leopard, since for the most part the included default version works very well.

How did you set up your snmpd.conf file for this?

--
John C. Welch         Writer/Analyst
Bynkii.com              Mac and other opinions
[hidden email]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macos-x-server mailing list      ([hidden email])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macos-x-server/lists%40nabble.com

This email sent to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Leopard's SNMP Extensible sections (exec) not working

Martin Capella
I added the line:

exec .1.3.6.1.4.1.2021.50 shelltest /bin/sh /tmp/shtest

Its how I have always done it.


On May 12, 2008, at 2:46 PM, John C. Welch wrote:

On 5/12/08 2:40 PM, "Martin Capella" <[hidden email]> wrote:

Extensible sections in Leopard's default SNMP (5.4.1) is broken. At least I can't get it to work. In SNMP 5.2.4 (which I compiled for Tiger server) it works. I don't want to have to compile a different version of snmp for Leopard, since for the most part the included default version works very well.

How did you set up your snmpd.conf file for this?

--
John C. Welch         Writer/Analyst
Bynkii.com              Mac and other opinions
[hidden email]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macos-x-server mailing list      ([hidden email])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macos-x-server/mcapella%40gmail.com

This email sent to [hidden email]


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macos-x-server mailing list      ([hidden email])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macos-x-server/lists%40nabble.com

This email sent to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Leopard's SNMP Extensible sections (exec) not working

John C. Welch
Re: Leopard's SNMP Extensible sections (exec) not working On 5/12/08 2:47 PM, "Martin Capella" <[hidden email]> wrote:

I added the line:

exec .1.3.6.1.4.1.2021.50 shelltest /bin/sh /tmp/shtest

Its how I have always done it.

What errors are you getting when you try to test?

--
John C. Welch         Writer/Analyst
Bynkii.com              Mac and other opinions
[hidden email]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macos-x-server mailing list      ([hidden email])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macos-x-server/lists%40nabble.com

This email sent to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Leopard's SNMP Extensible sections (exec) not working

Martin Capella
1. snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.50
returns nothing
 
2. snmpwalk -v 2c -c public localhost .1.3.6.1.4.1.2021.50
UCD-SNMP-MIB::ucdavis.50 = No Such Object available on this agent at this OID


3. snmpget -c public -v 1 localhost .1.3.6.1.4.1.2021.50 
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: UCD-SNMP-MIB::ucdavis.50


On May 12, 2008, at 3:06 PM, John C. Welch wrote:

On 5/12/08 2:47 PM, "Martin Capella" <[hidden email]> wrote:

I added the line:

exec .1.3.6.1.4.1.2021.50 shelltest /bin/sh /tmp/shtest

Its how I have always done it.

What errors are you getting when you try to test?

--
John C. Welch         Writer/Analyst
Bynkii.com              Mac and other opinions
[hidden email]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macos-x-server mailing list      ([hidden email])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macos-x-server/mcapella%40gmail.com

This email sent to [hidden email]


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macos-x-server mailing list      ([hidden email])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macos-x-server/lists%40nabble.com

This email sent to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Leopard's SNMP Extensible sections (exec) not working

John C. Welch
Re: Leopard's SNMP Extensible sections (exec) not working On 5/12/08 3:19 PM, "Martin Capella" <[hidden email]> wrote:

1. snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.50
returns nothing
 
2. snmpwalk -v 2c -c public localhost .1.3.6.1.4.1.2021.50
UCD-SNMP-MIB::ucdavis.50 = No Such Object available on this agent at this OID


3. snmpget -c public -v 1 localhost .1.3.6.1.4.1.2021.50
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: UCD-SNMP-MIB::ucdavis.50

The answer here is fairly obvious: the Mac OS X 10.5 SNMP implementation doesn’t support 2021.50, (if you start your snmpwalk at .1.3.6.1.4.1.2021, you’ll see this.) and in looking through the UCD MIB at http://www.shrubbery.net/mibs/UCD-SNMP-MIB.txt, I can’t really find it there either. What does 2021.50 show?

--
John C. Welch         Writer/Analyst
Bynkii.com              Mac and other opinions
[hidden email]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macos-x-server mailing list      ([hidden email])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macos-x-server/lists%40nabble.com

This email sent to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Leopard's SNMP Extensible sections (exec) not working

John C. Welch
In reply to this post by Martin Capella
Re: Leopard's SNMP Extensible sections (exec) not working On 5/12/08 7:09 PM, "Martin Capella" <[hidden email]> wrote:

2021.50 is what the snmpd.conf example states as the correct mib table for extensibility.

In any case, what I think what I need is to know the correct OID table that can be used to extend snmpd. I am glad that the issue is not with exec itself, but I would like to find out how to best extend snmp to read results from my scripts.

What specifically are you trying to do with the scripts?

As of now I am driving blind as the only SNMP browser for Mac OS,  CocoaSNMP 0.1 does not run on any of my intel 10.5 machines. The ireasoning JAVA MIB browser is not very stable either...

I just dump snmpwalk with both the –Of and –On to a text file. If you want a fantastic resource for mibs, try <http://www.mibdepot.com/>

In the meantime I've been graphing all the output from the LM-Sensors table:

You might want to try ipmitool too, if you are running xserves with the LOM enabled. What tool are you using SNMP with?

--
John C. Welch         Writer/Analyst
Bynkii.com              Mac and other opinions
[hidden email]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macos-x-server mailing list      ([hidden email])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macos-x-server/lists%40nabble.com

This email sent to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Leopard's SNMP Extensible sections (exec) not working

John C. Welch
In reply to this post by Martin Capella
Re: Leopard's SNMP Extensible sections (exec) not working On 5/12/08 7:09 PM, "Martin Capella" <[hidden email]> wrote:

It  shows nothing... :(

2021.50 is what the snmpd.conf example states as the correct mib table for extensibility.

The problem is, since that OID doesn’t exist, that could be your problem. Looking at the UCD MIB, it appears that 2021.8 is the “proper” OID to use for extending via commands. I’d hazard that the 2021.50 example is an attempt to show how you’d do it, using a nonexistant OID so you couldn’t accidently create a problem for yourself just by uncommenting those lines.

Looking at Andre’s examples, he’s using the .8 for that as well. You might want to consider trying that as your base OID for this.

--
John C. Welch         Writer/Analyst
Bynkii.com              Mac and other opinions
[hidden email]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macos-x-server mailing list      ([hidden email])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macos-x-server/lists%40nabble.com

This email sent to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Leopard's SNMP Extensible sections (exec) not working

nabbletemp
In reply to this post by Martin Capella
The answer is quite simple: the line in the default snmp.conf which you tried to use is misspelled.

You have to change this:

exec .1.3.6.1.4.1.2021.50 shelltest /bin/sh /tmp/shtest

into this:

extend .1.3.6.1.4.1.2021.50 shelltest /bin/sh /tmp/shtest

to get it working.