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

    Reading out the Temperature

    Scheduled Pinned Locked Moved SNMP
    5 Posts 5 Posters 3.7k 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.
    • R
      renegade
      last edited by

      Hi,

      i use mrtg to track my traffic.
      is it possible to read the temp via snmp as well?
      How?
      Thank you!

      1 Reply Last reply Reply Quote 0
      • H
        hardingnick
        last edited by

        Hi Renegade,

        I am just going through the same snmp config.

        I did a snmpwalk on my pfsense box and found this, hopefully when i convert this into an OID it will return the temps..

        HOST-RESOURCES-MIB::hrDeviceDescr.104 = STRING: amdtemp0: AMD CPU On-Die Thermal Sensors

        Hope this helps,

        Nick.

        1 Reply Last reply Reply Quote 0
        • A
          anitchaudhary
          last edited by

          Hello Nick and Renegade

          Did you ever find the temperature reading in any OID? I need to setup monitor and looking for a way to get the values in an OID.

          1 Reply Last reply Reply Quote 0
          • jimpJ
            jimp Rebel Alliance Developer Netgate
            last edited by

            Use the NET-SNMP package. On the Host Information tab, setup an Extended Command:

            • Type: extend
            • Name: gettemps
            • Program: /root/gettemps.sh

            Then in /root/gettemps.sh, put:

            #!/bin/sh
            /sbin/sysctl dev.cpu | /usr/bin/awk '/temperature/ {print $2;}'
            

            Set it executable, and then use the line-by-line extended OID to access it:

            : snmpwalk -c mycommunity -v 2c 127.0.0.1 nsExtendOutLine.\"gettemps\"
            NET-SNMP-EXTEND-MIB::nsExtendOutLine."gettemps".1 = STRING: 42.0C
            NET-SNMP-EXTEND-MIB::nsExtendOutLine."gettemps".2 = STRING: 42.0C
            NET-SNMP-EXTEND-MIB::nsExtendOutLine."gettemps".3 = STRING: 41.0C
            NET-SNMP-EXTEND-MIB::nsExtendOutLine."gettemps".4 = STRING: 42.0C
            

            Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

            Need help fast? Netgate Global Support!

            Do not Chat/PM for help!

            SetarcosS 1 Reply Last reply Reply Quote 4
            • SetarcosS
              Setarcos @jimp
              last edited by Setarcos

              @jimp

              A slight revision on /root/gettemps.sh if you just need the numeric temperature value and not the C (or F) designation :

              #!/bin/sh
              /sbin/sysctl dev.cpu | /usr/bin/awk '/temperature/ {print $2;}' | sed 's/[CF]//g'
              
              1 Reply Last reply Reply Quote 1
              • M mathwilp1011 referenced this topic on
              • SetarcosS Setarcos referenced this topic on
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.