[Plug-In] SNMP


Recommended Posts

I'm hoping I haven't missed this information somewhere, but is there a way to get disk temperature of disks that are not in the array (i.e. in pools) ? I can only see array drives when I do

 

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

 

Already tried adding 

 

disk /mnt/pool

 

to the SNMP configuration (the pool is called pool 🙂) but nothing...

 

Any advice?

Link to comment
9 minutes ago, d0rh4ns said:

I'm hoping I haven't missed this information somewhere, but is there a way to get disk temperature of disks that are not in the array (i.e. in pools) ? I can only see array drives when I do

 

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

 

Already tried adding 

 

disk /mnt/pool

 

to the SNMP configuration (the pool is called pool 🙂) but nothing...

 

Any advice?


There is a separate standalone script that parses the output of "mdcmd status" to determine what disks are installed: https://github.com/kubedzero/unraid-snmp/blob/main/source/usr/local/emhttp/plugins/snmp/disk_temps.sh#L52C18-L52C30
 

 here is some more information on the output of the mdcmd command

The SNMP configuration only will adjust the free/used disk space output and won't add on disk temperature. 

Link to comment

First of all, thanks for the super quick reply!!!

 

So what I'm getting from this is that mdcmd status only outputs array disks and no cache pools etc. 

What I don't quite understand is if there's a way to get those drives in there and if so, how. 

Edited by d0rh4ns
Link to comment
8 hours ago, d0rh4ns said:

First of all, thanks for the super quick reply!!!

 

So what I'm getting from this is that mdcmd status only outputs array disks and no cache pools etc. 

What I don't quite understand is if there's a way to get those drives in there and if so, how. 

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. That responsibility is held by smartctl, which is not unraid-specific. You just give it a disk mount point (aka /dev/sdb) and then it will report back temperature and SMART information https://github.com/kubedzero/unraid-snmp/blob/main/source/usr/local/emhttp/plugins/snmp/disk_temps.sh#L120

So you could make a script that determines what the non-pool drives are mounted as, and then calls smartctl for those /dev/sdX  paths. And then if you added that script to your SNMP config, it would start to show up in SNMP.

smartctl can actually do a scan for attached devices, aka `smartctl --scan` so you could always start there as well.

 

Hope that makes sense! Feel free to browse through the Github code for the disk temp script for further insight.

  • Like 2
Link to comment

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 was a proper UnRAID API to not have to deal with hacky workarounds like this.

  • Like 2
Link to comment
1 hour ago, d0rh4ns said:

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 was a proper UnRAID API to not have to deal with hacky workarounds like this.

Nice. Just in case you weren't aware, the modifications will be reset on each reboot, so you'll probably want to make a copy of the modified script on the /boot USB drive and then reference that script in your SNMP config instead of the default one.

Also, if your fix is generalized, feel free to submit a pull request and I can see about adding this for wider usage 😇

  • Upvote 1
Link to comment
  • 7 months later...

Hi,

i have installed the plugin and have installed a new virtual machine for prtg. 

The auto discovery search have a many result of datas over snmp. 

For me, the important thing is the temperature from the hdd´s and nvme´s. Unraid shows me that, but i want it in prtg. 

Does anyone know, how i add this information? Is the temperature a information from the snmp plugin?

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.