summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/smokeinfo21
1 files changed, 13 insertions, 8 deletions
diff --git a/bin/smokeinfo b/bin/smokeinfo
index 978f7bf..ed3519b 100755
--- a/bin/smokeinfo
+++ b/bin/smokeinfo
@@ -14,9 +14,9 @@ my $Revision = $1;
sub main()
{
# parse options
- my %opt = (mode=>'plain',pattern=>undef,separator=>';',format=>'%le');
+ my %opt = (mode=>'plain',filter=>undef,separator=>';',format=>'%le',start=>'end-24h');
- GetOptions(\%opt, 'help|h', 'man', 'version', 'noaction|no-action|n',
+ GetOptions(\%opt, 'help|h', 'man', 'version', 'noaction|no-action|n','no-head',
'start=s','end=s','pattern=s','mode=s','separator=s','format=s') or exit(1);
if($opt{help}) { pod2usage(1) }
if($opt{man}) { pod2usage(-exitstatus => 0, -verbose => 2) }
@@ -25,9 +25,9 @@ sub main()
my $config = shift @ARGV;
my $si = Smokeping::Info->new($config);
- my $nodes = $si->fetch_nodes(pattern=>$opt{pattern},mode=>$opt{mode});
+ my $nodes = $si->fetch_nodes(pattern=>$opt{filter},mode=>$opt{mode});
my @rows = qw(med_avg med_min med_max med_now loss_avg loss_max loss_now);
- print '# ',join $opt{separator}, 'node_path',@rows;
+ print '# ',join $opt{separator}, 'node_path',@rows if not $opt{'no-head'};
print "\n";
for my $node (@$nodes) {
my $data = $si->stat_node($node,'end-24h','now');
@@ -48,11 +48,11 @@ smokeinfo - poll smokeping site for numeric information
B<smokeinfo> path/to/config.cfg [I<options>]
- --start x rrd graph start time
+ --start x rrd graph start time. (default now-24h)
+
+ --end y rrd graph end time. (default now)
- --end y rrd graph end time
-
- --filter filter_pattern search pattern for node selection
+ --filter pattern search pattern for node selection
--mode plain (default) how to use the pattern
- plain
@@ -63,6 +63,8 @@ B<smokeinfo> path/to/config.cfg [I<options>]
--format %le (default)
+ --no-head do not print a header
+
--man show man-page and exit
-h, --help display this help and exit
--version output version information and exit
@@ -72,6 +74,9 @@ B<smokeinfo> path/to/config.cfg [I<options>]
SmokeInfo is a simple frontend to the L<Smokeping::Info> module. It provides
access to numeric data stored in the rrd files.
+Note that --start and --end are passed directly to rrd graph. This means
+they work on the same syntax.
+
=head2 Examples
Get all data all nodes