NAME

derived - run command periodically and calculate rate and check from network

SYNOPSIS

$ cat CmdsFile
slowqueries: mysql -NB -e 'show global status like "Slow_queries%"'
$ derived -p 12306 CmdsFile

$ telnet localhost 12306
get slowqueris
VALUE slowqueris 0 3
0.2  # slow queries/sec

DESCRIPTION

derived runs command periodically and capture integer value. And calculate per-second rate. You can retrieve these values from integrated memcached-protocol server

You can monitoring the variation of metrics through this daemon.

ARGUMENT

-h, --help

Display help message

-i

Interval seconds for running commands. Default 10.

--port: Required

Port number to bind

--host

IP address to bind

COMMAND FILE

A command file should contain both a name for the process and the command used to run it.

slowquery: mysql -NB -e 'show global status like "Slow_queries%"'
lines: wc -l /path/to/file

SERVER

You can access to data via integrated memcached-protocol server.

use Cache::Memcached::Fast;

my $memcached = Cache::Memcached::Fast->new({
  servers => [qw/localhost:12306/],
});

say $memcached->get('slowqueris'); # only per seconds value.
say $memcached->get('slowqueris:full'); #JSON formated data include raw values

AUTHOR

Masahiro Nagano <kazeburo@gmail.com>

LICENSE

Copyright (C) Masahiro Nagano

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.