Skip to content

Instantly share code, notes, and snippets.

@chrissearle
Created March 19, 2012 10:03
Show Gist options
  • Save chrissearle/2106154 to your computer and use it in GitHub Desktop.
Save chrissearle/2106154 to your computer and use it in GitHub Desktop.
Quick and dirty munin script for monitoring PMS FD/socket counts
/etc/munin/plugin-conf.d/munin-node
**snip**
[plex]
user root
/etc/munin/plugins/plex
#!/bin/sh
if [ "$1" = "config" ]; then
echo 'graph_title Plex FD count'
echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel Count'
echo 'graph_scale no'
echo 'graph_category Plex'
echo 'fd.label FD Count'
echo 'socket.label Socket Count'
exit 0
fi
if [ -f /var/run/plexserver.pid ]; then
PID=`cat /var/run/plexserver.pid`
echo -n "fd.value "
ls -l /proc/$PID/fd | grep lrwx | wc -l
echo -n "socket.value "
ls -l /proc/$PID/fd | grep lrwx | grep socket | wc -l
else
echo "fd.value 0"
echo "socket.value 0"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment