net-snmp and unRaid


Recommended Posts

Here's what I have so far

 

In my /boot/packages, I have the following 3 files:

root@Storage:/boot/packages# ls net-snmp* -l
-rwxrwxrwx 1 root root 1888292 2010-01-18 15:47 net-snmp-5.5-i486-2.txz*
-rwxrwxrwx 1 root root     243 2013-11-13 13:11 net-snmp.conf*
-rwxrwxrwx 1 root root     212 2013-11-13 12:35 net-snmp.install*

 

My install script looks like this

installpkg /boot/packages/libnl-1.1-i486-1.txz
installpkg /boot/packages/net-snmp-5.5-i486-2.txz
rm -rf /etc/snmp/snmpd.conf
ln -s /boot/packages/net-snmp.conf /etc/snmp/snmpd.conf
killall snmpd; /usr/sbin/snmpd

 

My config file looks like this (the disks are commented out for now)

# Basic info
syslocation     somewhere
syscontact      someone
rocommunity     public

# System info
#disk /mnt/disk1
#disk /mnt/disk2
#disk /mnt/disk3
#disk /mnt/disk4
#disk /mnt/disk5
#disk /mnt/disk6
#disk /mnt/disk7
#disk /mnt/cache

 

And this line is in my /boot/config/go script

# Install SNMPd
/boot/packages/net-snmp.install

 

 

So, I get everything up and going, I try to run a simple snmpwalk, and I get this:

root@Storage:/boot/packages# snmpwalk -v 1 -c public localhost 
Timeout: No Response from localhost

 

but, the daemon is running?

root@Storage:~# ps aux | grep snmpd
root     14689  0.0  0.1  10708  3808 ?        S    13:27   0:00 snmpd

 

And it's listening...

root@Storage:~# netstat -anp | grep 161
udp        0      0 0.0.0.0:161             0.0.0.0:*                           14689/snmpd  

 

Okay, let's log the output to the screen and see what I get

root@Storage:/etc# snmpd -Le
could not open /proc/net/if_inet6
cannot open /proc/net/snmp6 ...
Warning: no access control information configured.
  It's unlikely this agent can serve any useful purpose in this state.
  Run "snmpconf -g basic_setup" to help you configure the snmpd.conf file for this agent.

  NET-SNMP version 5.5
Connection from UDP: [127.0.0.1]:34509->[127.0.0.1]
Connection from UDP: [127.0.0.1]:34509->[127.0.0.1]
Connection from UDP: [127.0.0.1]:34509->[127.0.0.1]
Connection from UDP: [127.0.0.1]:34509->[127.0.0.1]
Connection from UDP: [127.0.0.1]:34509->[127.0.0.1]
Connection from UDP: [127.0.0.1]:34509->[127.0.0.1]  

 

Uh... What? So, it's connecting to the daemon, the passed community name and version should be right? What's going on?

 

I'm hitting a brick wall here... Help, please.

Link to comment

Pointed the daemon to the absolute path of the config

root@Storage:/etc/snmp# snmpd -c /etc/snmp/snmpd.conf -Le
could not open /proc/net/if_inet6
cannot open /proc/net/snmp6 ...
root@Storage:/etc/snmp# NET-SNMP version 5.5

Couple of ipv6 errors, but I'm not worried about that.

 

Let's try it again

root@Storage:/etc/snmp# snmpwalk -v 1 -c public localhost
SNMPv2-MIB::sysDescr.0 = STRING: Linux Storage 3.9.6p-unRAID #23 SMP Wed Jun 26 19:25:49 PDT 2013 i686
SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::org
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (1504) 0:00:15.04

And then there's about 500 more lines of information after that

 

And on the server side

Connection from UDP: [127.0.0.1]:48658->[127.0.0.1]
Connection from UDP: [127.0.0.1]:48658->[127.0.0.1]
Connection from UDP: [127.0.0.1]:48658->[127.0.0.1]
Connection from UDP: [127.0.0.1]:48658->[127.0.0.1]

And about 500 more lines of that.

 

All it took was a 2nd set of eyes. Thanks mate!

 

So, I did this because I couldn't find a simple, just snmp package. How can I go about wrapping this up for other users in case they want to run snmp? I'm sure there's people out there running cacti or mrtg (or whatever, zenoss, zabbix, etc...) at home

Link to comment

You will probably want to turn it into a Plugin. I know I would have used it rather than installing the unMenu MRTG package which comes with snmp.

 

Here's a start...

http://lime-technology.com/forum/index.php?topic=28433.msg252997#msg252997

 

 

Have you had any luck getting /mnt/user via SNMP?

 

I noticed I DO get /mnt/user0 though it's not in snmpd.conf which is odd. But its not accurate.

 

My df -h, snmpwalk and snmpd.conf:

root@Tower:~# df -h
Filesystem            Size  Used Avail Use% Mounted on
tmpfs                 128M   11M  118M   9% /var/log
/dev/sda              3.8G  475M  3.3G  13% /boot
/dev/md1              1.9T  1.8T   60G  97% /mnt/disk1
/dev/md2              1.9T  1.8T   51G  98% /mnt/disk2
/dev/md3              1.9T  1.8T   43G  98% /mnt/disk3
/dev/md4              1.9T  1.8T   83G  96% /mnt/disk4
/dev/md5              1.9T  1.8T   76G  96% /mnt/disk5
/dev/md6              1.9T  1.8T   59G  97% /mnt/disk6
/dev/md7              1.9T  1.8T   57G  97% /mnt/disk7
/dev/md8              1.9T  1.8T   47G  98% /mnt/disk8
/dev/md9              1.9T  1.8T  110G  95% /mnt/disk9
/dev/md10             932G  618G  315G  67% /mnt/disk10
/dev/md11             1.9T  582G  1.3T  32% /mnt/disk11
/dev/sdl1             466G  9.3G  457G   2% /mnt/cache
shfs                   20T   17T  2.2T  89% /mnt/user0
shfs                   20T   17T  2.6T  87% /mnt/user


root@Tower:/mnt# snmpwalk -v 2c -c cacti localhost hrFSMountPoint     
HOST-RESOURCES-MIB::hrFSMountPoint.1 = STRING: "/boot"
HOST-RESOURCES-MIB::hrFSMountPoint.2 = STRING: "/mnt/disk1"
HOST-RESOURCES-MIB::hrFSMountPoint.3 = STRING: "/mnt/disk2"
HOST-RESOURCES-MIB::hrFSMountPoint.4 = STRING: "/mnt/disk3"
HOST-RESOURCES-MIB::hrFSMountPoint.5 = STRING: "/mnt/disk4"
HOST-RESOURCES-MIB::hrFSMountPoint.6 = STRING: "/mnt/disk5"
HOST-RESOURCES-MIB::hrFSMountPoint.7 = STRING: "/mnt/disk6"
HOST-RESOURCES-MIB::hrFSMountPoint.8 = STRING: "/mnt/disk7"
HOST-RESOURCES-MIB::hrFSMountPoint.9 = STRING: "/mnt/disk8"
HOST-RESOURCES-MIB::hrFSMountPoint.10 = STRING: "/mnt/disk9"
HOST-RESOURCES-MIB::hrFSMountPoint.11 = STRING: "/mnt/disk10"
HOST-RESOURCES-MIB::hrFSMountPoint.12 = STRING: "/mnt/disk11"
HOST-RESOURCES-MIB::hrFSMountPoint.13 = STRING: "/mnt/cache"
HOST-RESOURCES-MIB::hrFSMountPoint.14 = STRING: "/mnt/user0"


root@Tower:/mnt# cat /boot/config/snmpd.conf 
rocommunity cacti
syslocation Here
syscontact [email protected]
disk /mnt/disk1
disk /mnt/disk2
disk /mnt/disk3
disk /mnt/disk4
disk /mnt/disk5
disk /mnt/disk6
disk /mnt/disk7
disk /mnt/disk8
disk /mnt/disk9
disk /mnt/disk10
disk /mnt/disk11
disk /mnt/disk12
disk /mnt/disk13
disk /mnt/disk14
disk /mnt/disk15
disk /mnt/disk16
disk /mnt/disk17
disk /mnt/disk18
disk /mnt/disk19
disk /mnt/disk20
disk /mnt/cache
root@Tower:/mnt# 

 

d0aadb289752710.jpg

Link to comment

snmpwalk -v 1 -c public localhost hrFSMountPoint
HOST-RESOURCES-MIB::hrFSMountPoint.1 = STRING: "/boot"
HOST-RESOURCES-MIB::hrFSMountPoint.2 = STRING: "/mnt/disk1"
HOST-RESOURCES-MIB::hrFSMountPoint.3 = STRING: "/mnt/user"

 

That's all I'm getting so far...

 

Thanks for sending me that link, I'll get started on hacking together a plugin. And thanks for pointing this out, I want to figure out a way to get individual shares reporting in their values as well as the entire array.

 

 

Link to comment
  • 3 months later...

... I'll get started on hacking together a plugin. And thanks for pointing this out, I want to figure out a way to get individual shares reporting in their values as well as the entire array.

 

If you are still plugging away at a plug-in, I'd be interested in giving a a test run (otherwise, I'll just mimic what you've done above).

 

Thanks,

 

John

 

Link to comment

So, I sort of got it working, but really it's just a package. It's feeding data into Cacti, and that's all I really care about.

 

My go script has this extra line

# Install SNMPd
/boot/packages/net-snmp.install

 

The net-snmp.install file looks like this

# Install dependencies
installpkg /boot/packages/libnl-1.1-i486-1.txz

# Install net-snmp
installpkg /boot/packages/net-snmp-5.5-i486-2.txz

# Clear out any old configs
rm -rf /etc/snmp/snmpd.conf

# Throw in the new config
ln -s /boot/custom/etc/snmp/snmpd.conf /etc/snmp/snmpd.conf

# kill any running snmp daemons
killall snmpd

# start the daemon with the new config
/usr/sbin/snmpd -c /etc/snmp/snmpd.conf

 

And that config file looks like this

# Basic info
syslocation Somewhere
syscontact Someone
rocommunity	public

# System info
#disk /mnt/disk1
#disk /mnt/disk2
#disk /mnt/disk3
#disk /mnt/disk4
#disk /mnt/disk5
#disk /mnt/disk6
#disk /mnt/disk7
#disk /mnt/cache

 

I know it's not much, but once it was working, I just quit worrying with it.

Link to comment

Thanks for the rundown.

 

I'm getting close.    It looks like Perl (or a portion thereof) is required.

 

Here's the message I received:

 

/usr/sbin/snmpd: error while loading shared libraries: libperl.so: cannot open shared object file: No such file or directory

 

Should I grab the whole Perl slackware package, or is there a simpler way to just get the required shared library?  I don't intend to run many plug-ins as I'm running unRAID as a VM as it is, and the other VMs will shoulder the heavy lifting.  I may end up with some other things that help with unRAID, and if many of those require Perl, maybe I should just bite the bullet.

 

Thanks,

 

John

 

Link to comment

Yeah, just grab perl. It won't hurt anything. No idea what needs it. I probably have something else using it as well, so it wasn't a direct dependency.

 

User error on my part.

 

When I went out to the Slackware site I mistakenly grabbed packages for the "current" release.  When I re-checked my work and went back to grab packages for the 13.1 release, there was no longer a dependency on Perl.

 

It's working fine now.

 

I've got my Zenoss monitoring system checking unRAID via SNMP.

 

Thanks!

 

John

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.