Created
July 28, 2010 06:32
Revisions
-
deepak revised this gist
Aug 19, 2010 . 1 changed file with 18 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -10,10 +10,23 @@ PLUGIN_NAME="passenger_status" while sleep "$INTERVAL" do /opt/ruby-enterprise-1.8.7-2010.02/bin/passenger-status > /tmp/collectd_passenger_stat /opt/ruby-enterprise-1.8.7-2010.02/bin/passenger-memory-stats > /tmp/collectd_passenger_mem max=$(cat /tmp/collectd_passenger_stat | fgrep max | awk '{print $3}') count=$(cat /tmp/collectd_passenger_stat | fgrep count | awk '{print $3}') active=$(cat /tmp/collectd_passenger_stat | fgrep -w active | awk '{print $3}') inactive=$(cat /tmp/collectd_passenger_stat | fgrep -w inactive | awk '{print $3}') waiting=$(cat /tmp/collectd_passenger_stat |fgrep Waiting | awk '{print $3}') sessions=$(awk '/Sessions/ {sum+=$4} END {print sum}' /tmp/collectd_passenger_stat) dirty_rss=$(tail -1 /tmp/collectd_passenger_mem | awk '{print $6}') echo "PUTVAL $HOSTNAME/$PLUGIN_NAME/gauge-max_value interval=$INTERVAL N:$max" echo "PUTVAL $HOSTNAME/$PLUGIN_NAME/gauge-running_value interval=$INTERVAL N:$count" echo "PUTVAL $HOSTNAME/$PLUGIN_NAME/gauge-active_value interval=$INTERVAL N:$active" echo "PUTVAL $HOSTNAME/$PLUGIN_NAME/gauge-inactive_value interval=$INTERVAL N:$inactive" echo "PUTVAL $HOSTNAME/$PLUGIN_NAME/gauge-waiting interval=$INTERVAL N:$waiting" echo "PUTVAL $HOSTNAME/$PLUGIN_NAME/gauge-sessions interval=$INTERVAL N:$sessions" echo "PUTVAL $HOSTNAME/$PLUGIN_NAME/gauge-dirty_rss_mem interval=$INTERVAL N:$dirty_rss" done -
deepak revised this gist
Jul 28, 2010 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,7 @@ #!/bin/bash # collectd plugin to monitor passenger # has better memory-requirement than a ruby script # TODO: try writing it in c - if it makes a difference HOSTNAME="production-host-01" INTERVAL="${COLLECTD_INTERVAL:-10}" -
deepak created this gist
Jul 28, 2010 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ #!/bin/bash #collectd plugin to monitor passenger HOSTNAME="production-host-01" INTERVAL="${COLLECTD_INTERVAL:-10}" PLUGIN_NAME="passenger_status" while sleep "$INTERVAL" do echo "PUTVAL $HOSTNAME/$PLUGIN_NAME/gauge-max_value interval=$INTERVAL N:124" echo "PUTVAL $HOSTNAME/$PLUGIN_NAME/gauge-running_value interval=$INTERVAL N:100" echo "PUTVAL $HOSTNAME/$PLUGIN_NAME/gauge-active_value interval=$INTERVAL N:100" echo "PUTVAL $HOSTNAME/$PLUGIN_NAME/gauge-total_sessions interval=$INTERVAL N:100" echo "PUTVAL $HOSTNAME/$PLUGIN_NAME/gauge-dirty_rss_mem interval=$INTERVAL N:119" done