[Plug-In] SNMP


256 posts in this topic Last Reply

Recommended Posts

  • Replies 255
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

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

SNMP is a standard way to get raw data from devices, for monitoring purposes. With this package, you can hook your UNRAID server up to a monitor, and track things like network usage, cpu activity, eve

ok so I installed it, but important question: where can I set the SNMP community string?

Posted Images

1 hour ago, pluginCop said:

giphy.gif

Ha! Sorry. I run unRAID within a VM under ESXi. Thus, I only use it for its NAS functionality with only a couple plugins: Nerd Tools, Open Files, SNMP, and a couple Dynamix ones. No need for CA with a setup as simple as this! Not to mention this is all on a 1GB USB key with very little free space :) 

Link to post

I've installed the new version of the plugin by @kubed_zero on three servers and it's working fine on two of them, with Observium generating graphs. On the third I'm getting this error message repeatedly (every three seconds) in my syslog starting immediately after installing the plugin and Observium believes the server to be offline:

May 31 18:16:30 Mandaue root: plugin: creating: /usr/local/emhttp/plugins/snmp/snmpd.conf - from INLINE content
May 31 18:16:30 Mandaue root: plugin: running: anonymous
### [PREVIOUS LINE REPEATED 1 TIMES] ###
May 31 18:16:30 Mandaue kernel: r8169 0000:05:00.0 eth2: Invalid ocp reg 2a3fe!
May 31 18:16:30 Mandaue root: plugin: running: anonymous
May 31 18:16:33 Mandaue kernel: r8169 0000:05:00.0 eth2: Invalid ocp reg 2a3fe!
### [PREVIOUS LINE REPEATED 439 TIMES] ###

If I uninstall the plugin the error message continues until I reboot. If I don't install the plugin my syslog is clean. I Googled the error message but got nothing relevant - Google seems fixated by military uniforms, latching on to "ocp" and failing to find a match for everything else. The two major differences between this server and the other two: firstly, it's running Unraid 6.7.1-rc1 (as opposed to 6.7.0 on the others) as a test; secondly, eth2 is the onboard Realtek NIC, which is unconfigured and unused, though not disabled in the BIOS, with eth0 and eth1 forming a bond, while the other servers have no unused NICs. One of them has a single Realtek NIC, which is configured as eth0 and is in use. The other has two Broadcom NICs in a bond. Diagnostics attached.

 

mandaue-diagnostics-20190531-1745.zip

 

EDIT: I was only running Unraid 6.7.1-rc1 as a test. The server doesn't have an Intel processor and doesn't need the MDS mitigations but in the light of this comment by Tom,

I thought it would be useful to test it. Anyway, I reverted to Unraid 6.7.0 on this server and the problem persists if I install the SNMP plugin. Attached diagnostics for Unraid 6.7.0.

 

mandaue-diagnostics-20190531-1859.zip

 

Edited by John_M
Reverted to 6.7.0 and error persists; typos
Link to post
5 minutes ago, John_M said:

The two major differences between this server and the other two: firstly, it's running Unraid 6.7.1-rc1 (as opposed to 6.7.0 on the others) as a test; secondly, eth2 is the onboard Realtek NIC

 

Wild. A quick Google for "realtek invalid ocp" gave me https://lists.openwall.net/netdev/2012/07/09/143 which makes me think it's something to do with the Realtek software stack, although I can't pinpoint exactly what's up. I wonder if it's the SNMP Slackware package trying to query/bind the different network interfaces in the system, and since the Realtek interface isn't disabled in the BIOS it finds that as well. This is just speculation though.

 

I'd suggest BIOS-disabling the unused Realtek NIC that's causing you issues, but would be interested in hearing anything else you find. Assuming the motherboards or network cards are different, maybe the working Realtek NIC is a different model than the one that's causing issues. Maybe the single Realtek NIC doesn't have problems because it's actively bound to an IP and is in use.

 

 

Link to post

I tried giving the unused port a static IP address but that didn't change anything. I want to try adding the port to the existing bond but today is scheduled parity check day so I'll leave it alone for now. I'll probably end up disabling the port in the BIOS.

Link to post
On 5/31/2019 at 5:21 PM, kubed_zero said:

Just created a new repo for this: https://github.com/kubedzero/unraid-community-apps-xml I don't use CA myself but I can spin up a test instance of unRAID later to confirm this works. That is assuming there's a way to reference this new XML file manually. 

Thanks for the updated plugin, test via CA on my test server Will update live server soon.

Edited by SimonF
Link to post
  • 2 weeks later...

Thank you for working to get this Plugin compatible with 6.7, but I can't get anything for the individual shares to work as I've seen in the thread:

 

root@Gothmog:~# snmpwalk -v 2c -c public localhost NET-SNMP-EXTEND-MIB::nsExtendOutLine
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".1 = STRING: WDC_WD100EMAZ-00WJTA0_2YJ0ZH9D: 31
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".2 = STRING: WDC_WD100EMAZ-00WJTA0_JEGKPT5N: 30
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".3 = STRING: WDC_WD100EFAX-68LHPN0_JEHM4AMN: 29
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".4 = STRING: WDC_WD100EFAX-68LHPN0_JEHM0D0N: 28
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".5 = STRING: WDC_WD80EMAZ-00WJTA0_7SJEAMEW: 32
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".6 = STRING: WDC_WD80EMAZ-00WJTA0_7SJHUD2W: 31
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".7 = STRING: WDC_WD40EFRX-68N32N0_WD-WCC7K3NHHZVR: 26
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".8 = STRING: WDC_WD40EFRX-68N32N0_WD-WCC7K2EC6CNJ: 25
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".9 = STRING: WDC_WD100EMAZ-00WJTA0_2YHVUKVD: 31
NET-SNMP-EXTEND-MIB::nsExtendOutLine."sharefree".1 = STRING: Plex_Media_Backup: 23271758839808
NET-SNMP-EXTEND-MIB::nsExtendOutLine."sharefree".2 = STRING: appdata: 1012790734848
NET-SNMP-EXTEND-MIB::nsExtendOutLine."sharefree".3 = STRING: domains: 1012790734848
NET-SNMP-EXTEND-MIB::nsExtendOutLine."sharefree".4 = STRING: isos: 22258968104960
NET-SNMP-EXTEND-MIB::nsExtendOutLine."sharefree".5 = STRING: system: 1012790734848


root@Gothmog:~# snmpwalk -v 2c -c public localhost NET-SNMP-EXTEND-MIB::nsExtendOutLine."sharefree".1
NET-SNMP-EXTEND-MIB::nsExtendOutLine.sharefree.1: Unknown Object Identifier (Index out of range: sharefree (nsExtendToken))

 

 

Cannot get it to work remotely at all either:

root@nagios:/# /opt/nagios/libexec/check_snmp -H 192.168.1.104 -C public -m NET-SNMP-EXTEND-MIB::nsExtendOutLine -o sharefree
External command error: MIB search path: /root/.snmp/mibs:/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf:/usr/share/mibs/site:/usr/share/snmp/mibs:/usr/share/mibs/iana:/usr/share/mibs/ietf:/usr/share/mibs/netsnmp
Cannot find module (nsExtendOutLine): At line 0 in (none)
sharefree: Unknown Object Identifier (Sub-id not found: (top) -> sharefree)

 

Link to post
  • 1 month later...
On 7/21/2019 at 9:39 AM, Fiala06 said:

Trying to install this and I get and when installing I'm getting this:

 

The log says /boot can't be found. It's failing on https://github.com/kubedzero/unraid-snmp/blob/main/snmp.plg#L229

 

When I try to run the command "snmpwalk -v 1 localhost -c public hrFSMountPoint" on my host I get 

 

root@myUnraid:~# snmpwalk -v 1 localhost -c public hrFSMountPoint
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.24 = STRING: "/dev/shm"
HOST-RESOURCES-MIB::hrFSMountPoint.25 = STRING: "/var/log"
HOST-RESOURCES-MIB::hrFSMountPoint.26 = STRING: "/boot"

It's also possible to run this replacing "localhost" with your host's IP address, like "192.168.0.2" or something. 

 

If you can try to run the SNMP command manually and show us what you see, that could be helpful. Perhaps it's just not running and you need to reboot/reinstall. Or perhaps /boot truly is missing, but I can't see how that would be possible. 

Edited by kubed_zero
Update PLG
Link to post
On 6/19/2019 at 10:01 AM, tronyx said:

Thank you for working to get this Plugin compatible with 6.7, but I can't get anything for the individual shares to work as I've seen in the thread:

 


root@Gothmog:~# snmpwalk -v 2c -c public localhost NET-SNMP-EXTEND-MIB::nsExtendOutLine
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".1 = STRING: WDC_WD100EMAZ-00WJTA0_2YJ0ZH9D: 31
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".2 = STRING: WDC_WD100EMAZ-00WJTA0_JEGKPT5N: 30
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".3 = STRING: WDC_WD100EFAX-68LHPN0_JEHM4AMN: 29
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".4 = STRING: WDC_WD100EFAX-68LHPN0_JEHM0D0N: 28
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".5 = STRING: WDC_WD80EMAZ-00WJTA0_7SJEAMEW: 32
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".6 = STRING: WDC_WD80EMAZ-00WJTA0_7SJHUD2W: 31
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".7 = STRING: WDC_WD40EFRX-68N32N0_WD-WCC7K3NHHZVR: 26
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".8 = STRING: WDC_WD40EFRX-68N32N0_WD-WCC7K2EC6CNJ: 25
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".9 = STRING: WDC_WD100EMAZ-00WJTA0_2YHVUKVD: 31
NET-SNMP-EXTEND-MIB::nsExtendOutLine."sharefree".1 = STRING: Plex_Media_Backup: 23271758839808
NET-SNMP-EXTEND-MIB::nsExtendOutLine."sharefree".2 = STRING: appdata: 1012790734848
NET-SNMP-EXTEND-MIB::nsExtendOutLine."sharefree".3 = STRING: domains: 1012790734848
NET-SNMP-EXTEND-MIB::nsExtendOutLine."sharefree".4 = STRING: isos: 22258968104960
NET-SNMP-EXTEND-MIB::nsExtendOutLine."sharefree".5 = STRING: system: 1012790734848


root@Gothmog:~# snmpwalk -v 2c -c public localhost NET-SNMP-EXTEND-MIB::nsExtendOutLine."sharefree".1
NET-SNMP-EXTEND-MIB::nsExtendOutLine.sharefree.1: Unknown Object Identifier (Index out of range: sharefree (nsExtendToken))

 

 

Cannot get it to work remotely at all either:


root@nagios:/# /opt/nagios/libexec/check_snmp -H 192.168.1.104 -C public -m NET-SNMP-EXTEND-MIB::nsExtendOutLine -o sharefree
External command error: MIB search path: /root/.snmp/mibs:/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf:/usr/share/mibs/site:/usr/share/snmp/mibs:/usr/share/mibs/iana:/usr/share/mibs/ietf:/usr/share/mibs/netsnmp
Cannot find module (nsExtendOutLine): At line 0 in (none)
sharefree: Unknown Object Identifier (Sub-id not found: (top) -> sharefree)

 

Wrap your identifier in a set of single quotes so the double quotes don't get interpreted by the CLI:

 

root@myUnraid:~# snmpwalk -v 2c -c public localhost 'NET-SNMP-EXTEND-MIB::nsExtendOutLine."sharefree"'
NET-SNMP-EXTEND-MIB::nsExtendOutLine."sharefree".1 = STRING: CoolShare1: 446446297088
NET-SNMP-EXTEND-MIB::nsExtendOutLine."sharefree".2 = STRING: RandomShare: 446446297088
NET-SNMP-EXTEND-MIB::nsExtendOutLine."sharefree".3 = STRING: SharedShare: 392926117888

 

Link to post
1 hour ago, kubed_zero said:

Wrap your identifier in a set of single quotes so the double quotes don't get interpreted by the CLI:

 


root@myUnraid:~# snmpwalk -v 2c -c public localhost 'NET-SNMP-EXTEND-MIB::nsExtendOutLine."sharefree"'
NET-SNMP-EXTEND-MIB::nsExtendOutLine."sharefree".1 = STRING: CoolShare1: 446446297088
NET-SNMP-EXTEND-MIB::nsExtendOutLine."sharefree".2 = STRING: RandomShare: 446446297088
NET-SNMP-EXTEND-MIB::nsExtendOutLine."sharefree".3 = STRING: SharedShare: 392926117888

 

 

Thank you, that resolved the local execution issue, but remote still isn't working:

 

root@e21f3a6e04c4:/# /opt/nagios/libexec/check_snmp -H 192.168.1.104 -C public -m 'NET-SNMP-EXTEND-MIB::nsExtendOutLine -o sharefree'
No OIDs specified
root@e21f3a6e04c4:/# /opt/nagios/libexec/check_snmp -H 192.168.1.104 -C public -m 'NET-SNMP-EXTEND-MIB::nsExtendOutLine -o sharefree.1'
No OIDs specified
root@e21f3a6e04c4:/# /opt/nagios/libexec/check_snmp -H 192.168.1.104 -C public -m 'NET-SNMP-EXTEND-MIB::nsExtendOutLine -o "sharefree"'
No OIDs specified

 

Link to post
2 minutes ago, tronyx said:

 

Thank you, that resolved the local execution issue, but remote still isn't working:

 


root@e21f3a6e04c4:/# /opt/nagios/libexec/check_snmp -H 192.168.1.104 -C public -m 'NET-SNMP-EXTEND-MIB::nsExtendOutLine -o sharefree'
No OIDs specified
root@e21f3a6e04c4:/# /opt/nagios/libexec/check_snmp -H 192.168.1.104 -C public -m 'NET-SNMP-EXTEND-MIB::nsExtendOutLine -o sharefree.1'
No OIDs specified
root@e21f3a6e04c4:/# /opt/nagios/libexec/check_snmp -H 192.168.1.104 -C public -m 'NET-SNMP-EXTEND-MIB::nsExtendOutLine -o "sharefree"'
No OIDs specified

 

I don't know what "check_snmp" is but if you use "snmpwalk" remotely it works fine. Sorry, can't help you here beyond saying:

- the same command I posted earlier with localhost subbed out for the IP address and executed from a Mac on the network runs fine 

- you might want to consider using the same SNMP implementation, aka "snmpwalk." Otherwise, you should go hunt through the documentation for the SNMP tool you're using to figure out how to pass in the arguments correctly.

- It could also be that whatever host OS you're using is interpreting quote characters differently

 

good luck! 

Link to post
  • 1 month later...

Did someone ever get the drive temps into observium / librenms?

if I do a snmpwalk or run drive.temp.sh script I get the right results.

 

root@unRAID:~# /usr/local/emhttp/plugins/snmp/drive_temps.sh 
WDC_WD60EFRX-68L0BN1_WD-WX21DC7APCD1: 36
WDC_WD60EFRX-68L0BN1_WD-WX21DC74DY6X: 37
WDC_WD60EFRX-68L0BN1_WD-WX21DC74D7RF: 37
WDC_WD60EFRX-68L0BN1_WD-WX21DC7APUNY: 36
root@unRAID:~# snmpwalk -v 2c localhost -c public 'NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp"'
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".1 = STRING: WDC_WD60EFRX-68L0BN1_WD-WX21DC7APCD1: 36
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".2 = STRING: WDC_WD60EFRX-68L0BN1_WD-WX21DC74DY6X: 37
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".3 = STRING: WDC_WD60EFRX-68L0BN1_WD-WX21DC74D7RF: 37
NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".4 = STRING: WDC_WD60EFRX-68L0BN1_WD-WX21DC7APUNY: 36

 

Edited by svenvg93
Link to post
  • 3 months later...
4 hours ago, ufo56 said:

How to set permanent snmpd password other than "public" ? 

If i change from /usr/local/emhttp/plugins/snmp/snmpd.conf it gets changed back to public after restart

That location is in RAM which is why it does not survive a reboot..

 

to make it survive a reboot you need a copy of the file to be put onto the flash drive and then a command added to the config/go file on the flash drive to copy the saved copy to the required runtime position.

Link to post
  • 2 months later...
On 3/7/2020 at 1:24 AM, etsi said:

Do I have to reinstall the plugin after every reboot?

You shouldn't have to, no. However, it does need the internet at boot time (it redownloads the PLG file and the SNMP library file and icons) every time it installs. That means that it will fail to install if the network isn't online or is still initializing when unRAID boots up. That said, once it does boot up you can reinstall the plugin by pointing to the copy already on the flash drive, either /boot/config/plugins/snmp.plg or /boot/config/plugins-error/snmp.plg to get it installed. 

 

I'm hoping to get some time soon to look into other plugin maintainers to see how they manage to reduce network calls during installation. Hopefully in a future version of SNMP it won't have to connect to the network at install time unless it's a first time install, meaning boot time install can just use files cached on the USB drive.

Link to post
  • 4 weeks later...
On 3/7/2020 at 12:24 AM, etsi said:

Do I have to reinstall the plugin after every reboot?

 

All installed plugins reinstall automatically every boot, since /usr/local/emhttp does not persist between reboots since it lives in RAM.

 

I've made an optimization that downloads this plugin's files first to the persistent USB storage and then copies the files into the working directory in RAM. That means once this update is applied, until the files' MD5 sums change the reinstall on each reboot will use the already-downloaded copy. 

 

The code change has been pushed https://github.com/kubedzero/unraid-snmp/commit/6d4d8a77e4c44e827b19f9814fab5b7debfa90b9 and should be available for users to update. 

 

Let me know if you have questions or suggestions! 

Link to post
  • 2 weeks later...

Hello I have installed the plugin but where can I find the settings. I don't find anything under Settings.

 

There were also no errors during the installation. However, if I look again after the installation and apps, I can reinstall it, normally there should be a gear there. However, I do not have this.

 

If I look under Installed Apps it doesn't show up there either, but I look and there are plugins inside.

 

Regards Maggi

Edited by Maggi0r
Link to post
28 minutes ago, Maggi0r said:

Hello I have installed the plugin but where can I find the settings. I don't find anything under Settings.

 

There were also no errors during the installation. However, if I look again after the installation and apps, I can reinstall it, normally there should be a gear there. However, I do not have this.

 

If I look under Installed Apps it doesn't show up there either, but I look and there are plugins inside.

 

Regards Maggi

There are no settings to adjust in the GUI, you could check on the PLG file to see how it's configured and how the config file is generated and then make edits yourself. 

 

What do you want to find the settings for? 

Link to post
On 4/14/2020 at 1:05 PM, Maggi0r said:

Thanks for the quick feedback, I thought I would see the SNMP MIBs there.

 

Or did I misunderstand the plugin but can I use it to read data from the unRaid server?

 

Regards Maggi

I see, I don't think the MIBs are listed anywhere but an snmpwalk command should list everything out for you. The original author of this plugin also added a couple extended MIBs for getting the disk temperatures and free Unraid Share space. Here's the example of the MIB for the extensions https://github.com/kubedzero/unraid-snmp/blob/main/snmp.plg#L269 https://github.com/kubedzero/unraid-snmp/blob/main/snmp.plg#L274

 

 

Edited by kubed_zero
Update PLG
Link to post
3 hours ago, Maggi0r said:

Sorry if I ask something stupid but how do I get the MIBS displayed in the console when I do snmpwalk -m I only get the help again and again.

 

Regards Maggi

You'll have better luck actually reading the snmpwalk man page https://helpmanual.io/help/snmpwalk/, but from your Unraid console running

snmpwalk -v 2c localhost -c public

will print out all MIBs and their current values. For my system that's 4046 values. Then you can use the link/command I sent earlier to output a specific MIB that you want to see. 

Link to post

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.