Created
March 19, 2012 10:03
-
-
Save chrissearle/2106154 to your computer and use it in GitHub Desktop.
Quick and dirty munin script for monitoring PMS FD/socket counts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/etc/munin/plugin-conf.d/munin-node | |
**snip** | |
[plex] | |
user root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/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