Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Extending Net-SNMP

 
Post new topic   Reply to topic    Cacti Forum Index -> Help: Linux/Unix Specific
Author Message
Fred
Cacti User


Joined: 03 Jan 2003
Posts: 78

PostPosted: Fri Jun 06, 2003 9:47 am    Post subject: Extending Net-SNMP Reply with quote

I know that this isn't technically the right forum, but I've been unable to find any good resources on how to extend SNMP. I'd like to gather some other information from my remote linux hosts, and while I used an ssh host to do it in the past, I feel like doing it with snmp is more secure and the "right" way to go about it.

I'm completely comfortable writing scripts in bash and perl, or even C code if I have to, but how do I get SNMP to spit it out on a get?

I found this to add to snmpd.conf in another thread:
Code:
exec    .1.3.6.1.4.1.2021.60 yourscriptname /usr/local/bin/yourscriptname.pl


But with my trial script, snmpd then fails to start. How do I know which OID to assign it to? What should the output of the script look like?

Any good on-line resources on how to do things like this? I'm running Net-SNMP 5.0.8 installed from source with cacti 0.8...
Back to top
Koyaanisqatsi



Joined: 10 Jun 2003
Posts: 6
Location: San Luis Obispo, CA

PostPosted: Tue Jun 10, 2003 1:44 pm    Post subject: Reply with quote

Hi Fred,

I usually obtain unknown SNMP OIDs from hosts by running the following commands on a Linux box:

shell> snmpwalk <hostname> <community> .1 > oids.alpha
shell> snmpwalk -On <hostname> <community> .1 > oids.numeric

Then open both output files in separate windows, side by side and scan through them for useful OIDs. The alpha file will have recognizable text names and the numeric file will have the OIDs that you can use in the generic SNMP gathering scripts in Cacti or any other polling tool.

It's slow, but effective.
Back to top
CompuKid101
Guest





PostPosted: Tue Jun 10, 2003 7:28 pm    Post subject: Reply with quote

lets see... i was doing this with netsnmp in cygwin because i couldnt figure out how to do it with window's snmp service


i put this in my snmp config:

exec temps /bin/perl /root/temps/test

and it added it to its own automatic OID

make a perl script that simply prints a unique value then snmpwalk localhost and grep for it

that should give you the area that net-snmp adds the execs output to the OIDs


Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Help: Linux/Unix Specific All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group