refining output

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
User avatar
egarnel
Cacti Pro User
Posts: 708
Joined: Thu Nov 21, 2002 8:55 am
Location: Austin, TX

refining output

Post by egarnel »

I wrote a script that polls for used ips in a dhcp scope and when run from a command line, returns back the correct number, say 218. When I run it thru cacti, however, it will sometimes return the number in decimal form - 218.01. What setting do I need to change in order for cacti to get rid of the .01?

Thanx
User avatar
egarnel
Cacti Pro User
Posts: 708
Joined: Thu Nov 21, 2002 8:55 am
Location: Austin, TX

More info

Post by egarnel »

Here is the script:

#!/usr/bin/perl

$alive = `/bin/fping -g 198.214.233.30 198.214.233.250 > /tmp/233_dhcp.log 2>&1`;
$alive = `/bin/grep -c 'alive' /tmp/233_dhcp.log > /tmp/233alive`;
open (INPUT, "</tmp/233alive")
or die "couldn't open file\n";
while (<INPUT>) {
chomp;
print "$_\n";}


works fine from cmd line, but returns odd numbers in graph
using gauge option, perhaps absolute?
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

I think you should use GAUGE as a data source type and select "exact numbers" as a GPRINT options in your graph definition.

- bulek
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest