I wrote a data source script to grab the current number of active and disconnected citrix sessions in use on a couple of our Sun servers (license capacity planning/monitoring). I created the data source and graphs for each server (daily, weekly, monthly, yearly) in Cacti and everything seemed to be working as expected. Problem is, it does not seem to be keeping my maximum values. For instance, one server had a total of 11 connections when I first set it up. 11 was the max all the way through, until it rolled off the mothly graph and now the yearly has dropped to 8. It seems there is some unwanted averaging going on where I want the maximum values retained.
Here is my data source:
Code: Select all
/usr/bin/rrdtool create \
/var/www/html/cacti/rra/citrix_searay.rrd \
--step 300 \
DS:act:GAUGE:600:0:100000 \
DS:dis:GAUGE:600:0:100000 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \
Code: Select all
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-33053184 \
--end=-0s \
--title="Citrix Users on Searay" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="Citrix Users" \
DEF:a="/var/www/html/cacti/rra/citrix_searay.rrd":act:AVERAGE \
DEF:b="/var/www/html/cacti/rra/citrix_searay.rrd":dis:AVERAGE \
CDEF:cdefi=a,b,+ \
AREA:a#00FF00:"Active" \
GPRINT:a:LAST:" Current\:%4.0lf" \
GPRINT:a:AVERAGE:"Average\:%4.0lf" \
GPRINT:a:MAX:"Maximum\:%4.0lf\n" \
STACK:b#0000FF:"Disconnected" \
GPRINT:b:LAST:"Current\:%4.0lf" \
GPRINT:b:AVERAGE:"Average\:%4.0lf" \
GPRINT:b:MAX:"Maximum\:%4.0lf\n" \
LINE1:cdefi#000000:"Total" \
GPRINT:cdefi:LAST:" Current\:%4.0lf" \
GPRINT:cdefi:AVERAGE:"Average\:%4.0lf" \
GPRINT:cdefi:MAX:"Maximum\:%4.0lf\n"
The maximums are all I really care about and need to be accurate. Another current example of a server showing wrong information for my purposes is our standy citrix machine that sees little activity. The current daily graph shows 0 active, 0 disconnected, and 0 total which is correct. The current weekly graph also shows 0 connections across the board which is also correct as nobody has connected to it in that amount of time. The first week of the monthly graph shows the highest number of connections with 1 active, 2 disconnected, and 3 total which I believe to be correct although I think it is possible that it could be wrong. Now where it is noticably wrong is in the yearly graph where it shows 0 active, 1 disconected, and 2 total. NOTE that all of the above numbers come from the GPRINT MAX columns on the graphs, the ones that mean the most to me.
It seems like this would be a simple and normal need, much like plain old maximum logged in users but I've looked at logged in user graphs as an example and they seem to be set up the same way. I feel like I am missing something simple but I've worked through it with a coworker and we're both stumped. Thanks for any help/suggestions!