Sebastian Mogilowskis Blog

Just another blog about administration, linux and other stuff

Monitoring an Coldfusion server with Cacti

I don’t found a coldfusion template for Cacti so i created one. It uses cfstat. I use Cacti and coldfusion on Debian Linux.

First you need a script to call the cfstat command on the coldfusion server:


# This script call the coldfusion server stat service and format the output for cacti
# 2008 by Mogilowski Sebastian

# Settings:
# Check argument
if [ $# -ne 1 ]
  echo "Usage: `basename $0` <hostname>"
  exit $E_BADARGS

# Using command line argument 1 for hostname

# Request statistics from the coldfusion stat service
STAT_OUTPUT=`ssh -i $SSH_KEY_FILE $SSH_USER@$HOSTNAME /opt/coldfusion8/bin/cfstat -n -x`

# Format the output for cacti
IFS=" "
echo "Pg/Sec_Now:"${ARRAY_OUTPUT[0]}" Pg/Sec_Hi:"${ARRAY_OUTPUT[1]}"
      DB/Sec_Now:"${ARRAY_OUTPUT[2]}" DB/Sec_Hi:"${ARRAY_OUTPUT[3]}"
      CP/Sec_Now:"${ARRAY_OUTPUT[4]}" CP/Sec_Hi:"${ARRAY_OUTPUT[4]}"
      Reqs_Qed:"${ARRAY_OUTPUT[6]}" Reqs_Rung:"${ARRAY_OUTPUT[7]}"
      Reqs_TOed:"${ARRAY_OUTPUT[8]}" Templ_Qed:"${ARRAY_OUTPUT[9]}"
      Templ_Rung:"${ARRAY_OUTPUT[10]}" Templ_TOed:"${ARRAY_OUTPUT[11]}"
      Flash_Qed:"${ARRAY_OUTPUT[12]}" Flash_Rung:"${ARRAY_OUTPUT[13]}"
      Flash_TOed:"${ARRAY_OUTPUT[14]}" CFC_Qed:"${ARRAY_OUTPUT[15]}"
      CFC_Rung:"${ARRAY_OUTPUT[16]}" CFC_TOed:"${ARRAY_OUTPUT[17]}"
      WebS_Qed:"${ARRAY_OUTPUT[18]}" WebS_Rung:"${ARRAY_OUTPUT[19]}"
      WebS_TOed:"${ARRAY_OUTPUT[20]}" AvgQ_time:"${ARRAY_OUTPUT[21]}"
      AvgReq_Time:"${ARRAY_OUTPUT[22]}" AvgDB_Time:"${ARRAY_OUTPUT[23]}"
      Bytes_In/Sec:"${ARRAY_OUTPUT[24]}" Bytes_Out/Sec:"${ARRAY_OUTPUT[25]}

This script calls cfstat via ssh on the coldfusion server, and format the data for cacti. With the parameter -n you disable the header output and option -x enables all values. For manual for remote command execution with ssh use google or You don’t need root permissons for cfstat. You can download the script here:


Save it in the script directory of cacti.(Debian: /usr/share/cacti/site/scripts/

Now you have to create the cacti templates. Look at the documentation of cacti for more informations. Here is my template:


This values will be graphed: AvgQ Time, AvgReq Time, AvgDB Time, Req TO’ed

Some screenshots:

Please give me feedback for this template.

Note: Only available for singe server instance of coldfusion, because cfstat is not available in the multiserver configuration.

, , , , , ,

One thought on “Monitoring an Coldfusion server with Cacti

  • mark neale says:

    Thanks for this. After some experimentation I have got this to work I think. One comment, you cannot use the ‘/’ character in Cacti output variables in your script so things like Bytes_In/Sec must instead read Bytes_In_Sec

    I have also had to resort to using telnet and expect to get the data off my W2008 server onto my Linux Cacti host.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.