Hi,
First, thank you to the developers and contributors for Cacti.
FreeBSD doesn't have /proc/uptime like Linux, so I wrote a small trivial script which takes no arguments, and prints out the uptime in days. Here it is:
#!/usr/bin/perl
my $boottime = `sysctl -h kern.boottime`;
$boottime =~ s/.* sec = ([0-9+].*)\,.*/$1/;
print int((time-$boottime)/86400);
I run it from the command line, and it does just what I want--print out the number of uptime days, no carriage return even:
shell# ./freebsd_uptime.pl
349shell#
(349 days is the correct number.)
This format is the same as the sample scripts included with Cacti, so far so good.
I then followed the very good "HowTo: Using Data Queries and Data Input Methods" to start graphing uptime. However, the graph (which I only started running today) is showing a value of 13.26k. I don't understand where this number is coming from. I did notice that 13,260 is evenly divisible by 60, to 221. Still that's nothing at all like 349.
Any ideas?
Thanks,
Ted
[/img]
FreeBSD Uptime Script problem
Moderators: Developers, Moderators
FreeBSD Uptime Script problem
- Attachments
-
- graph_image.php.png (19.25 KiB) Viewed 1672 times
Check your path, use strict;
sysctl isn't in your path,
so $boottime is undefined,
so you are printing time/86400
so $boottime is undefined,
so you are printing time/86400
Who is online
Users browsing this forum: No registered users and 0 guests