cat > /etc/cron.d/apkpm <<__CRON__
# m h dom mon dow user command
*/15 * * * * dpavlin /srv/APKPM/cron.sh CPE_poll
-*/15 * * * * dpavlin /srv/APKPM/cron.sh poll_ZTEDSLAM
-*/15 * * * * dpavlin /srv/APKPM/cron.sh poll_ZTEMSAN
+*/15 * * * * dpavlin /srv/APKPM/cron.sh ZTEDSLAM_poll
+*/15 * * * * dpavlin /srv/APKPM/cron.sh ZTEMSAN_poll
__CRON__
exit
if ( $ret ) {
$self->do_background_json( 'Store_insert', {
- _table => $vendor,
+ _table => 'cpe_' . $vendor,
ip => $ip,
username => $username,
timestamp => $self->datetime_now,
}
$self->do_background_json( 'Store_insert', {
- _table => 'dslam_h',
+ _table => 'dslam',
ip => $crm->{IP_MANAGEMENT}, # FIXME IP_UREDAJA ?
username => $username,
timestamp => $self->datetime_now,
+ variant => $variant,
h => $self->to_hstore($hash),
});
max_processes => 1,
min_processes => 0,
worker => $worker,
- name => "poll_$variant",
+ name => $variant . '_poll',
methods => [ {
- name => "poll_$variant",
+ name => $variant . '_poll',
encode => 'e_json',
body => sub {
my $row = $status->{poll}->{$variant};
$row->{$_} = $status->{"$variant.poll.$_"} foreach ( 'start', 'finish' );
$row->{variant} = $variant;
- $self->do_background_json('Store_insert', { _table => 'zte_poll', %$row });
- warn "# zte_poll ",dump($row);
+ $self->do_background_json('Store_insert', { _table => 'dslam_poll', %$row });
+ warn "# dslam_poll ",dump($row);
my $ips = scalar keys %$seen;
my $ports = 0;
$ports += scalar keys %{ $seen->{$_} } foreach keys %$seen;
warn "# finish $ips ips with $ports ports\n";
- return { ips => $ips, ports => $ports, zte_poll => $row } ; # body end
+ return { ips => $ips, ports => $ports, dslam_poll => $row } ; # body end
}
} ],
});
--- /dev/null
+create table cpe_davolink (
+ip inet not null,
+username text not null,
+timestamp timestamp default now(),
+h hstore
+);
+
+-- columns used in where for gnuplot
+create index davolink_username on cpe_davolink(username);
+create index davolink_timestamp on cpe_davolink(timestamp) ;
+
--- /dev/null
+create table cpe_easygateway (
+ip inet not null,
+username text not null,
+timestamp timestamp default now(),
+h hstore
+);
+
+-- columns used in where for gnuplot
+create index easygateway_username on cpe_easygateway(username);
+create index easygateway_timestamp on cpe_easygateway(timestamp) ;
+
+++ /dev/null
-create table davolink (
-ip inet not null,
-username text not null,
-timestamp timestamp default now(),
-h hstore
-);
-
--- columns used in where for gnuplot
-create index davolink_username on davolink(username);
-create index davolink_timestamp on davolink(timestamp) ;
-
--- /dev/null
+create table dslam (
+ip inet not null,
+username text not null,
+timestamp timestamp default now(),
+variant text not null,
+h hstore
+);
+
+-- columns used in where for gnuplot
+create index dslam_username on dslam(username);
+create index dslam_timestamp on dslam(timestamp) ;
+create index dslam_variant on dslam(variant) ;
+
--- /dev/null
+create table dslam_poll (
+ variant text not null,
+ start timestamp not null,
+ finish timestamp not null,
+ -- grep '$variant.$ip.' persistant_worker.pl | cut -d\" -f2
+ logout int,
+ error int,
+ empty int,
+ ok int,
+ invalid int,
+ queued int,
+ complete int,
+ failed int
+);
+
+create index dslam_poll_variant on dslam_poll(variant);
+create index dslam_poll_start on dslam_poll(start);
+++ /dev/null
-create table easygateway (
-ip inet not null,
-username text not null,
-timestamp timestamp default now(),
-h hstore
-);
-
--- columns used in where for gnuplot
-create index easygateway_username on easygateway(username);
-create index easygateway_timestamp on easygateway(timestamp) ;
-
timestamp timestamp default now(),
rtt float
);
+
+create index ping_ip on ping(ip);
+create index ping_username on ping(username);
+++ /dev/null
-create table zte_poll (
- variant text not null,
- start timestamp not null,
- finish timestamp not null,
- -- grep '$variant.$ip.' persistant_worker.pl | cut -d\" -f2
- logout int,
- error int,
- empty int,
- ok int,
- invalid int,
- queued int,
- complete int,
- failed int
-);
-