[Plug-In] SNMP


256 posts in this topic Last Reply

Recommended Posts

18 hours ago, kubed_zero said:

In essence, this update modifies the SNMP installer script to look on the /boot drive for an SNMP config file to use, preferring that over the bundled config if it exists. This means that even without using the UI, you can get a custom SNMP file to load up without any adjustments to the go file or anything else.

 

I'm having issues updating due to failing at this point even though I don't have a custom SNMP config.  SNMP seems to be working fine, I'm even monitoring free diskspace on /boot via snmp so very curious about this

snmpwalk -v 2c localhost -c public hrFSMountPoint
snmpwalk failureCouldn't find /boot mount point. SNMP output:
Timeout: No Response from localhost
plugin: run failed: /bin/bash retval: 1

 

Link to post
  • 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

Posted (edited)
2 hours ago, PacMain said:

I'm having issues updating due to failing at this point even though I don't have a custom SNMP config.  SNMP seems to be working fine, I'm even monitoring free diskspace on /boot via snmp so very curious about this

snmpwalk -v 2c localhost -c public hrFSMountPoint
snmpwalk failureCouldn't find /boot mount point. SNMP output:
Timeout: No Response from localhost
plugin: run failed: /bin/bash retval: 1

 

Huh, I didn't edit anything related to this bit. Specifically, what it's failing on is that it's trying to call snmpwalk after SNMP is started, and it's getting back "No Response from localhost" instead of a valid SNMP response. That sounds to me though as if SNMP failed to start up.

- If you reboot and try to update again, does it work?

- An alternative would be to uninstall SNMP, reboot, and then reinstall with the newest version.

 

I'm not sure what version of SNMP/Unraid you're currently on, but there have been some adjustments in more recent versions to make updating safer. 

Edited by kubed_zero
Clarified the nature of the failure
Link to post

Just updated my server with the new version. Was a bit more work because I manually editted the existing plugin so I could test my changes so it did not allow me to update :) Simply removed it, rebooted just to be sure, downloaded the new version and pasted my config. Works like a charm :D

 

Fantastic that now everybody can do it like this simply through the UI!

Link to post
  • 3 weeks later...
2 hours ago, Kacper said:

I am trying to find disk temperature with snmpwalk, but I cannot. What oid it suppose to be or what string should i search for to find disk temperature?

NET-SNMP-EXTEND-MIB::nsExtendOutLine."disktemp".2 = STRING: WDC_WD100EMAZ-00WJTA0_JEGKPT5N: 30

Here's an example of how it will look.

 

Here's one way of calling SNMP to get just the custom stuff: snmpwalk -v 2c -c public localhost nsExtendOutLine

 

You can also uninstall and reinstall the plugin and the installation logs will give you an example of how to call SNMP, along with what your system's output currently is. 

Link to post

I've noticed a problem related to the changes I've made regarding saving the config file. Last night my server went down due to a lightning strike killing the power. And I've notices it remained offline on my monitoring. So: I checked the config but hey there are no "snmp" settings anymore how strange. Went to reinstall/download the plugin and then I saw:

 

Executing install script for unraid-snmp-2021.05.21-x86_64-1.txz.
Set permissions and move into dir /usr/local/emhttp/plugins/snmp
Set shell script executable permissions
Set read only permissions for other files
Checking if /etc/rc.d/rc.snmpd exists before editing
Stop SNMP daemon if it is currently running
Shutting down snmpd: DONE
Using the user-defined config /boot/config/plugins/snmp/snmpd.conf, backing up the original
Editing SNMP startup options in rc.snmpd to be [-LF 0-5 /var/log/snmpd.log -A -p /var/run/snmpd -a]
Restart SNMP daemon now that we've adjusted how rc.snmpd starts it
Starting snmpd: /usr/sbin/snmpd -LF 0-5 /var/log/snmpd.log -A -p /var/run/snmpd -a -c /etc/snmp/snmpd.conf
PID of started SNMP daemon is 20036
Package unraid-snmp-2021.05.21-x86_64-1.txz installed.

+==============================================================================
| Testing SNMP by listing mounts, /boot should be present
+==============================================================================

snmpwalk -v 2c localhost -c public hrFSMountPoint
snmpwalk failureCouldn't find /boot mount point. SNMP output:
Timeout: No Response from localhost
plugin: run failed: /bin/bash retval: 1

Updating Support Links



Finished Installing. If the DONE button did not appear, then you will need to click the red X in the top right corner

 

So yeah! If it uses my config then accessing localhost with public as a community does not work! When rebooting it "reinstalls" the plugin and that seem to fail. No idea why this did not happen to me when testing it....

 

So @kubed_zero I think we can do a couple of things:

- First start the service with default config in order to test it, then restart it with the user config

- Always append a `rocommunity public 127.0.0.1` to allow this to happen

- Don't fail when the snmpwalk fails (when using custom config)

 

Do you have any preferences? For me I now have added option 2 as that was the quickest way to fix it.

 

It seems when manually installing it the plugin IS installed (I have the settings) but when I check the installed plugins it is not listed so that might be somekind of Unraid bug.

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.