I have setup cacti to monitor 5 ascend max tnt's to show current analog and isdn connections, and also to show the average and max of those 2. I have the graph just the way I want it, and it looks rather spiffy. The only problem I'm having is that it's showing current users as for instance "436.92". I don't have a .92 user connected
Here's how I have it setup.
I created a data source to use an input source of "Get SNMP Data". The data source goes to my tnt's, gets the appropriate info based on the OID set. The log file shows that once every 5 mins, it pulls the correct value, let's say of 346. I setup the graph to include the graph items I want to see; basicly current users, average users, maximum users, and total current, average and max users.
Now, my graph is showing me for instance
320.72 users. How can I make cacti use the actual number it recieves back from my tnt's snmp server as the current number?
Amount of current users on RAS box is being averaged?
Moderators: Developers, Moderators
There are two reasons for this. One is probably because you are using the default RRA's which do not save explicit data for the LAST CF. You can change that under "Round Robin Archives", but would require you to re-create your .rrd files.
I do not think doing this would completly solve your problem though because of how rrdtool stores numbers.
Another option would be to create a CDEF to somehow round the numbers to make a whole number (not sure exactly how you would do this).
The last option would be to use cacti own builtin variables. However this functionality might change somewhat in future versions since I am not a big fan of SQL INSERTS for each data source every 5 minutes. In short, cacti stores that last value returned from a script in its database. This would only be good for the LAST value though, not AVERAGE or MAXIMUM. To use this simply put a <oid> in the text format field of the graph item. 'oid' represents the data name for the output field of the "Get SNMP Data Script".
So in my opinion the least hacked up option would be to use a CDEF. Hopefully someone knows exactly how this can be done.
-Ian
I do not think doing this would completly solve your problem though because of how rrdtool stores numbers.
Another option would be to create a CDEF to somehow round the numbers to make a whole number (not sure exactly how you would do this).
The last option would be to use cacti own builtin variables. However this functionality might change somewhat in future versions since I am not a big fan of SQL INSERTS for each data source every 5 minutes. In short, cacti stores that last value returned from a script in its database. This would only be good for the LAST value though, not AVERAGE or MAXIMUM. To use this simply put a <oid> in the text format field of the graph item. 'oid' represents the data name for the output field of the "Get SNMP Data Script".
So in my opinion the least hacked up option would be to use a CDEF. Hopefully someone knows exactly how this can be done.
-Ian
Ok... I think I may have found the solution, but, I'm having some weird problems. I hacked a perl script I had been using for MRTG to get the total analog users from our tnt, and created a data input source for it. The cron printout shows "perl /var/www/html/cacti/scripts/tntanalogusers.pl tntlbb-1.nts-online.net ****". I then created a data source that's using the data input I created, and created a graph using the data input. NOW, it works and pulls the correct data and graphs the correct data (no rounding or averageing), but, it doesn't pull any information if the cmd.php is executed from the crontab. I can manually do a "php cmd.php", tail the rrd.log, and I show that it pulls the correct amount of users and produces "03/07/2002 1:48 PM - CMD: /usr/bin/rrdtool update /var/www/html/cacti/rra/tntlbb-1_analog.rrd N:294". But, if I watch the log file when crontab executes it, all I see is "03/07/2002 1:40 PM - CMD: /usr/bin/rrdtool update /var/www/html/cacti/rra/tntlbb-1_analog.rrd N:U" which doesn't update the .rrd file with anything. Any hints as to where to start from here? I'm so close I can smell victory, but, I can't see the finish line.
I have had problems like this before and more times then not it was with the script itself. I am not sure how you gather data from your TNT's, I presume it is via SNMP. Many programs throw a fit when you do not execute them under a shell; hence the need for backticks.
One time I was trying to graph data from from wget and I had this happen. To fix it, I did this:
$status=`/bin/bash -c 'wget --quiet -O - http://192.168.100.1/cgibin/opcfg'`;
See if that does any good for you.
-Ian
One time I was trying to graph data from from wget and I had this happen. To fix it, I did this:
$status=`/bin/bash -c 'wget --quiet -O - http://192.168.100.1/cgibin/opcfg'`;
See if that does any good for you.
-Ian
Well, I thought I had it working, but, now it's starting to give me 346.30 users again. I guess my question is, by default you have a "Logged In Users" graph that all it does is report how many users are logged into the local machine. I added a max item onto the graph to see if that was screwing me up, but, it still reports whole and true numbers.
The Logged in users graph shows 3 users. When I check the log file, the last info it pulled from the script was "3".
My TNT Users graph shows the current users to be 85.60 while the log file shows the last data pulled is 284?
The Logged in users graph shows 3 users. When I check the log file, the last info it pulled from the script was "3".
My TNT Users graph shows the current users to be 85.60 while the log file shows the last data pulled is 284?
Who is online
Users browsing this forum: No registered users and 1 guest