Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    SNMP - LibreNMS Monitor Temperature Option (NET-SNMP)

    Scheduled Pinned Locked Moved SNMP
    1 Posts 1 Posters 1.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mathwilp1011
      last edited by

      Hi All,

      Just thought I would give back to the community to monitor your pfSense for temperature through SNMP. Find this useful please leave a comment.

      Prerequisites:
      NET-SNMP package from pfSense
      LibreNMS
      SSH access to pfSense with basic VI editing skills
      Linux skills

      Log into pfSense to Shell (8):
      Create a file called gettemps.sh through VI:
      vi /root/gettemps.sh

      File content:
      #!/bin/sh
      /sbin/sysctl dev.cpu | /usr/bin/awk '/temperature/ {print $2;}' | sed 's/[F]//g'

      Save and quit the file.

      Make it executable:
      chmod the file to make it executable
      chmod +x /root/gettemps.sh

      Go to pfSense > Services > NET-SNMP > Host Information
      Add into the Extended Commands
      Name: gettemps
      Program: /root/gettemps.sh
      Save
      (note: the Name in the screenshot has been chopped off - it is gettemps)

      Go to pfSense SSH
      If running SNMP v3 use (replace variables):
      snmpget -v 3 -l authPriv -a SHA -A [password] -u snmp -x AES -X [password] [fw-hostip] nsExtendOutputFull."gettemps"

      If running SNMP v2c use (replace variables):
      snmpwalk -c public -v 2c [fw-hostip] nsExtendOutLine."gettemps"
      Output should look like this below:
      NET-SNMP-EXTEND-MIB::nsExtendOutputFull."gettemps" = STRING:
      44.0C
      48.0C
      44.0C
      47.0C

      Take the MIB after the two colons(::) nsExtendOutputFull."gettemps" that you get (my example is above) and add it to the LibreNMS Custom OID field. Set limits etc. Save it off.

      Wait about 15 minutes and there will be a chart drawn up.

      To view the data now go to:
      You can now monitor your temperature of the pfSense through LibreNMS.

      Any issues let me know. Thanks.
      M.

      References:
      https://forum.netgate.com/topic/107545/reading-out-the-temperature/4
      https://www.reddit.com/r/PFSENSE/comments/cnjddc/howto_retrieve_cpu_temp_and_other_data_over_snmp/

      1 Reply Last reply Reply Quote 3
      • First post
        Last post
      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.