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

    Updated: Munin-node on PFsense 2.0.x

    Scheduled Pinned Locked Moved pfSense Packages
    5 Posts 2 Posters 2.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
      robi
      last edited by

      I followed this forum thread and found some more tweaks to make it work more nicely.

      Just follow the steps described in the two posts of that thread. (if you run into a 'Broken pipe' error and installation stops, just start it again immediately)

      Additional steps:

      Edit /usr/local/etc/munin/munin-node.conf to add your allowed munin servers and disable log:```
      log_level 0
      log_file /tmp/munin-node.log
      pid_file /tmp/nmunin-node.pid

      allow ^192.168.10.12$

      
      If you happen to have an Intel or an AMD CPU in your pfSense box you can add temperature monitoring to the dashboard [like described here](http://forum.pfsense.org/index.php/topic,52301.0.html), and based on that you can even add graphing of these in munin, with this plugin, named "pfsense_temps":
      

      #!/bin/sh

      Plugin to monitor Jetway motherboard CPU temperatures on pfSense controller runtime data. Installation:

      - copy this plugin script to /usr/local/share/munin/plugins/, make it executable

      - symlink it to /usr/local/etc/munin/plugins/

      - restart munin-service

      case $1 in
        config)
              cat <<'EOM'
      graph_title CPU Temperatures
      graph_vlabel Degrees C
      graph_category sensors
      cpu_0.label Core 0
      cpu_1.label Core 1
      cpu_2.label Core 2
      cpu_3.label Core 3

      EOM
              exit 0;;
      esac

      temp0=$(/sbin/sysctl dev.cpu.0.temperature|awk '{print $2}')
      echo -n 'cpu_0.value '; echo $temp0|awk '{gsub(/C/,"")};{print}'
      temp1=$(/sbin/sysctl dev.cpu.1.temperature|awk '{print $2}')
      echo -n 'cpu_1.value '; echo $temp1|awk '{gsub(/C/,"")};{print}'
      temp2=$(/sbin/sysctl dev.cpu.2.temperature|awk '{print $2}')
      echo -n 'cpu_2.value '; echo $temp2|awk '{gsub(/C/,"")};{print}'
      temp3=$(/sbin/sysctl dev.cpu.3.temperature|awk '{print $2}')
      echo -n 'cpu_3.value '; echo $temp3|awk '{gsub(/C/,"")};{print}'

      
      Add them to munin installation:```
      cd /usr/local/etc/munin/plugins/
      ln -s /usr/local/share/munin/plugins/pfsense_temps pfsense_temps
      ln -s /usr/local/share/munin/plugins/uptime uptime
      

      To have pfSense's interface names shown in munin's web interface, modify the plugins if_ and if_errcoll_ as below.

      Add this line below INTERFACE=…```
      INTERFACENAME=/etc/rc.banner | grep "$INTERFACE" | awk '{print($1)}'

      
      Replace in the config section of the plugin $INTERFACE with $INTERFACENAME as shown below:```
      echo "graph_title Interface $INTERFACENAME Traffic"
      echo "graph_info This graph shows the traffic of the $INTERFACENAME network interface."
      echo "obytes.info Traffic sent (+) and received (-) on the $INTERFACENAME network interface."
      

      The auto-detected interfaces emc0 and pfsync0 don't graph anything for me, and since they are not present in the interfaces list on the SSH login banner either, i've deleted their symlink from /usr/local/etc/munin/plugins/.

      1 Reply Last reply Reply Quote 0
      • R
        robi
        last edited by

        I'm successfully graphing OpenVPN virtual interfaces too. One thing to take care about is when you add new OpenVPN connections, they are not added automatically to munin-node, the symlink to that interface needs to be created automatically.

        1 Reply Last reply Reply Quote 0
        • R
          robi
          last edited by

          Guys, is there a way to programatically find out which is the current default gateway set up on the WAN port?

          I'd like to write a munin plugin to ping that regularily, and measure ping times.

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

            If you are only looking for the default gateway, then this should work:

            route -n get default | awk '/gateway:/ { print $2; }'
            

            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!

            1 Reply Last reply Reply Quote 0
            • R
              robi
              last edited by

              Cool!

              I think it deserves a dedicated pfSense package…

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