Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Plug-In] SNMP

Featured Replies

  • Author

Hey folks,

 

Looks like I goofed up the github URL, so you're not going to see updates to the SNMP package unless you uninstall and reinstall. Sorry about that. FYI the only update in a while has been the fix for this problem.

  • 2 weeks later...
  • Replies 391
  • Views 137.6k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • kubed_zero
    kubed_zero

    Created a pull request for the Coppit package on GitHub https://github.com/coppit/unraid-snmp/pull/6 but it doesn't seem like they've been active since August 2018 on here or on GitHub.   Wi

  • kubed_zero
    kubed_zero

    That is an Unraid-specific executable as far as I'm aware, so I think trying to get it showing up there would be a dead end. On the other hand, you don't actually need mdcmd to get disk temp. Tha

  • Thanks a bunch, kubed_zero! I ended up modifying that disk_temps.sh script to also include the drives that were missing before and pointed SNMP to that modified copy.    Man, if only there w

Posted Images

Hi Guys,

 

Not sure if any of you will be able to help me, i can't get my head around observium, do i install it as bridge or host?

if i go bridge i can access observium but can't add any devices, and if i go host it has a cry about sql, i believe because i am already running mysql on port 3306

 

Ideas?

 

Cheers,

Hi coppit,

is there any chance to add the drive temperatures to the MIBs the same way, you added the unraid drives?

 

hmm i'm past that part and i don't wanna delete unraid but i will if you can't get it working. try this first, it's just

 

hostname = tower

protocol version = v2c

port = 161

snmp community = public

 

pretty sure everything else was blank/default.

 

I can't seem to add unRaid as a device. Using those settings I get:

 

Adding host Tower community public port 161

Could not resolve Tower.

Hi coppit,

is there any chance to add the drive temperatures to the MIBs the same way, you added the unraid drives?

.. and while thinking about it: It would be nice to add the up/down state also to MIBs - that would give a great historical view on the spinning status of the drives!

Is this possible?

Checked it myself - if I understand it correct, it should be possible:

See http://www.net-snmp.org/docs/man/snmpd.conf.html

So snmpd.conf has to be extended by Agent functionality.

Current content of /usr/local/emhttp/plugins/snmp/snmpd.conf is:

rocommunity public
syslocation Here
syscontact root@tower
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

Extended agents could be implemented like this:

Extending Agent Functionality

Arbitrary Extension Commands

Old Style

    exec [MIBOID] NAME PROG ARGS"
    sh   [MIBOID] NAME PROG ARGS"
    execfix NAME PROG ARGS"

New Style

    extend [MIBOID] NAME PROG ARGS"
    extendfix [MIBOID] NAME PROG ARGS"

So if it is possible to get the information from emhttp via perl, it should be doable, iiuc?

Sorry for another post, but continued some reading and it seems that also shell scripts are supported:

# Run a shell script containing:
#
# #!/bin/sh
# echo hello world
# echo hi there
# exit 35
#
# exec .1.3.6.1.4.1.2021.50 shelltest /bin/sh /tmp/shtest

# Other ideas:
#
# exec .1.3.6.1.4.1.2021.51 ps /bin/ps
# exec .1.3.6.1.4.1.2021.52 top /usr/local/bin/top
# exec .1.3.6.1.4.1.2021.53 mailq /usr/bin/mailq

So it shouldn't be too difficult to use the respective parts from e.g. dynamix temp plugin (shell script), that is already determining temperature and disk status and output to a MIB.

 

# Identify the drives in your array so we can test their temperature
COUNT=1
for d in $(ls /dev/[hs]d? | grep -v "$flash")
do
<------>HD[$COUNT]=$d
<------>#echo HDD=${HD[$COUNT]}><------><------><------><------><------><------><------># Uncomment for debugging
<------>COUNT=$[$COUNT+1]
done
<------>while [ $CURRENT_DRIVE -le $NUM_OF_DRIVES ]
<------>do
<------><------>SLEEPING=`hdparm -C ${HD[$CURRENT_DRIVE]} | grep -c standby`
<------><------>if [ "$SLEEPING" -eq 0 ]; then
<------><------><------>CURRENT_TEMP=`smartctl -A ${HD[$CURRENT_DRIVE]} | grep -m 1 -i Temperature_Celsius | awk '{print $10}'`
<------><------>fi
<------><------>CURRENT_DRIVE=$[$CURRENT_DRIVE+1]
<------>done

hdparm tells us, if the drive is in standby - smartctrl tells us the drive's temp.

Question: I had a look into myMain.awk code of unmenu - it also uses smartctl to gather disk temp - and also gets them when disk is spun down - iirc, this is not possible with all drives/manufacturers, but it would be nice to get temps continously :-).

I did a quick test with my drives on the command line and smartctl -A /dev/sdx does not spin up the drive and nicely reports the data...

Hope that helps?

  • Author

I can't seem to add unRaid as a device. Using those settings I get:

 

Adding host Tower community public port 161

Could not resolve Tower.

 

Try using the IP address instead?

I can't seem to add unRaid as a device. Using those settings I get:

 

Adding host Tower community public port 161

Could not resolve Tower.

 

Try using the IP address instead?

 

Adding host 192.168.1.8 community public port 161

Could not resolve 192.168.1.8.

Screenshot_1.png.b02e2e1e5e542f72ca1275d5c5a5c252.png

You have to provide hostname which can be resolved to IP address. Resolution can happen e.g in your home router.

In other words Observium only accepts hostnames.

You have to provide hostname which can be resolved to IP address. Resolution can happen e.g in your home router.

In other words Observium only accepts hostnames.

 

I gave up. Thanks for looking.

is it possible to configure snmp to not log every single connection it gets? after 10 days, the snmp log file is about 40MB...

  • 2 weeks later...

Is there a way to test to make sure it is installed and working right? Having trouble trying to connect to observium.

 

On another computer I tried to telnet to tower on port 161 which should at least connect if the port is open but doesn't work.

 

Thanks

  • Author

Is there a way to test to make sure it is installed and working right? Having trouble trying to connect to observium.

 

On installation it does a self-test. Uninstall and reinstall to double-check it.

Is there a way to test to make sure it is installed and working right? Having trouble trying to connect to observium.

 

On installation it does a self-test. Uninstall and reinstall to double-check it.

 

Installed and feeding data to MRTG (old school, I know).  Now to see what OIDs are good to watch!

  • Author

Hi all,

 

I've dropped the log level to "warning", and it so far hasn't put anything in my log. That should help with disk usage. :)

 

I've also integrated drive temperatures:

 

$ snmpwalk -v 2c localhost -c public 'NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp"'
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".1 = STRING: ST3000DM001-1ER166_W500ARQN: 31
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".2 = STRING: ST3000DM001-1ER166_W500QFEF: 35
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".3 = STRING: WDC_WD20EARS-00MVWB0_WD-WMAZA3285404: 36
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".4 = STRING: ST2000DL003-9VT166_5YD317TZ: 37
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".5 = STRING: WDC_WD20EARS-00MVWB0_WD-WMAZA3209264: 37
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".6 = STRING: TOSHIBA_DT01ACA200_734L5LLKS: 42
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".7 = STRING: WDC_WD20EARS-00MVWB0_WD-WMAZA2183297: 35

 

Unfortunately drive temps are like the only thing Observium doesn't handle automatically. This thread might give you some idea of how to set it up.

I've also integrated drive temperatures

 

Nice.  I just updated the plug-in, but I'm not seeing temperatures, either in your installation test, or from my SNMP monitoring server.  Here's the snippet from your installation:

 

 

 

+==============================================================================
| Testing SNMP by listing mounts
+==============================================================================
Looks like snmpd is working... Output:
HOST-RESOURCES-MIB::hrFSMountPoint.1 = STRING: "/mnt/disk1"
HOST-RESOURCES-MIB::hrFSMountPoint.2 = STRING: "/mnt/disk2"
HOST-RESOURCES-MIB::hrFSMountPoint.3 = STRING: "/mnt/disk3"
HOST-RESOURCES-MIB::hrFSMountPoint.22 = STRING: "/var/log"
HOST-RESOURCES-MIB::hrFSMountPoint.25 = STRING: "/boot"


Here's what drive temperatures look like:
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp" = No Such Instance currently exists at this OID

-----------------------------------------------------------
snmp has been installed.
Copyright 2015, David Coppit 
Version: 2015.08.24
-----------------------------------------------------------

 

Thanks,

 

John

 

  • Author

I'm not seeing temperatures, either in your installation test, or from my SNMP monitoring server

 

Doh. I forgot to install the helper script. Try version 2015.08.25. Hopefully this time the test output will show drive temps.

 

I'm not 100% sure the temps will be picked up by your monitor. If you can find any docs on what the monitor queries for, I can see about supporting it.

Doh. I forgot to install the helper script. Try version 2015.08.25. Hopefully this time the test output will show drive temps.

 

I'm not 100% sure the temps will be picked up by your monitor. If you can find any docs on what the monitor queries for, I can see about supporting it.

 

Hmm...  On the plus side, this plug-in architecture works great!

 

Here's the fresh output - no real change:

 

+==============================================================================
| Testing SNMP by listing mounts
+==============================================================================
Looks like snmpd is working... Output:
HOST-RESOURCES-MIB::hrFSMountPoint.1 = STRING: "/mnt/disk1"
HOST-RESOURCES-MIB::hrFSMountPoint.2 = STRING: "/mnt/disk2"
HOST-RESOURCES-MIB::hrFSMountPoint.3 = STRING: "/mnt/disk3"
HOST-RESOURCES-MIB::hrFSMountPoint.22 = STRING: "/var/log"
HOST-RESOURCES-MIB::hrFSMountPoint.25 = STRING: "/boot"


Here's what drive temperatures look like:
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp" = No Such Instance currently exists at this OID

-----------------------------------------------------------
snmp has been installed.
Copyright 2015, David Coppit 
Version: 2015.08.25
-----------------------------------------------------------

plugin: updated

 

unRAID can see the temps - as shown in the screen shot below.  To complicate things - My unRAID system is a virtual guest on VMware ESXi.  The disk controller is "passed through" to the VM, and is dedicated to the VM, as are all the attached disks.

 

Thanks,

 

 

John

 

temps.png.368ee7a09190d3fcd6b3e9f6097a3059.png

  • Author

Can you log into your server and run the following?

 

/usr/local/emhttp/plugins/snmp/drive_temps.sh 

 

Hi, I just did and it lists all my hard drives with a colon but no temperatures at all. Drives are all spun down though. Hope this helps, Alex. PS: I'm on the latest version of the plugin.

Can you log into your server and run the following?

 

/usr/local/emhttp/plugins/snmp/drive_temps.sh 

 

That worked:

 

root@OshTank:~# /usr/local/emhttp/plugins/snmp/drive_temps.sh 
WDC_WD20EFRX-68EUZN0_WD-WCC4M0927675: 28
WDC_WD20EFRX-68EUZN0_WD-WCC4M4PJF00N: 28
WDC_WD20EFRX-68EUZN0_WD-WCC4M3PHD4DE: 29
WDC_WD20EFRX-68EUZN0_WD-WCC4M0072449: 27
root@OshTank:~# 

  • Author

Hi, I just did and it lists all my hard drives with a colon but no temperatures at all. Drives are all spun down though. Hope this helps, Alex. PS: I'm on the latest version of the plugin.

 

Yeah, I can't always get temps if the disks are spun down.

  • Author

That worked:

 

Well, is the config file updated properly?

 

$ tail -n 1 /usr/local/emhttp/plugins/snmp/snmpd.conf 
extend disktemp /usr/local/emhttp/plugins/snmp/drive_temps.sh

 

What happens if you run it manually?

 

snmpwalk -v 2c localhost -c public 'NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp"'

 

If that works, you can try restarting snmpd:

 

bash /etc/rc.d/rc.snmpd stop
bash /etc/rc.d/rc.snmpd start

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.