Updated: Munin-node on PFsense 2.0.x
-
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.pidallow ^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 3EOM
exit 0;;
esactemp0=$(/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/.
-
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.
-
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.
-
If you are only looking for the default gateway, then this should work:
route -n get default | awk '/gateway:/ { print $2; }'
-
Cool!
I think it deserves a dedicated pfSense package…