Commit 8b78ae89 authored by ueli heuer's avatar ueli heuer 👾
Browse files

Merge branch 'php7'

parents 6d13895c 2f5ccfca
tmp
etc
log
dump
wwwstat
#!/usr/bin/perl -w
#
# Copyright (C) 2003...2013 Ueli Heuer
# Copyright (c) Ueli Heuer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -16,8 +16,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# $Id$
# {{{ perldoc page
=head1 NAME
......
#!/usr/bin/perl -w
#
# Copyright (C) 2002 ... 2014 Ueli Heuer
# Copyright (c) Ueli Heuer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -16,7 +16,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# $Id$
# {{{ perldoc page
=head1 NAME
......
#!/usr/bin/perl -w
#
# Copyright (C) 2005 ... 2013 Ueli Heuer
# Copyright (c) Ueli Heuer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -16,8 +16,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# $Id$
# {{{ perldoc page
=head1 NAME
......
#!/usr/bin/perl -w
#
# Copyright (C) 2005 ... 2013 Ueli Heuer
# Copyright (c) Ueli Heuer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -16,8 +16,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# $Id$
# {{{ perldoc page
=head1 NAME
......
#!/usr/bin/perl -w
#
# Copyright (C) 2005 ... 2013 Ueli Heuer
# Copyright (c) Ueli Heuer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -16,7 +16,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# $Id$
# {{{ perldoc page
=head1 NAME
......
#!/usr/bin/perl -w
#
# Copyright (c) 2002 ... 2013 by ueli@dvgtool.org
# Copyright (c) Ueli Heuer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -17,8 +17,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
#
# $Id$
# {{{ perldoc page
=head1 NAME
......
#!/usr/bin/perl -w
#
# Copyright (c) 2002 ... 2013 by ueli@dvgtool.org
# Copyright (c) Ueli Heuer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -17,8 +17,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
#
# $Id$
# {{{ perldoc page
=head1 NAME
......
#!/usr/bin/perl -w
#
# Copyright (C) 2005 ... 2013 by Ueli Heuer
# Copyright (c) Ueli Heuer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -16,7 +16,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# $Id$
# {{{ perldoc page
=head1 NAME
......
#!/usr/bin/perl
#
# Copyright (C) 2004 ... 2013 Ueli Heuer
# Copyright (c) Ueli Heuer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -15,7 +15,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# $Id$
# {{{ perldoc
=head1 NAME
......
#!/usr/bin/perl -w
#
# Copyright (c) 2008 ... 2013 by Ueli Heuer
# Copyright (c) Ueli Heuer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -16,8 +16,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# $Id$
# {{{ perldoc page
=head1 NAME
......
#!/usr/bin/perl
#
# Copyright (C) 2002 ... 2014 Ueli Heuer ueli@dvgtool.org
# Copyright (c) Ueli Heuer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -16,9 +16,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# $Id$
## {{{ perdoc page
=head1 NAME
......@@ -56,7 +53,7 @@ Generate the trafficreport from the last month (mostly useful in a crontab)
The year of the report. You have to use 4-digit notation. The default is the
current year.
=item B<--month>
The month of the report (01 -> januar ... 12 -> december). There is no
......
#!/usr/bin/perl -w
#
# Copyright (C) 2005 ... 2017 Ueli Heuer ueli@dvgtool.org
# Copyright (c) Ueli Heuer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -16,8 +16,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# $Id: dvg_snmpd.pl,v 1.28 2015/07/25 11:00:19 ueli Exp $
# {{{ perldoc page
=head1 NAME
......@@ -304,6 +302,11 @@ my %OID = (
'rndMng' => '.1.3.6.1.4.1.9.6.1.101.1',
# pfStateTable
'pfStateTableCount' => '.1.3.6.1.4.1.12325.1.200.1.3.1',
'pfStateTableSearches' => '.1.3.6.1.4.1.12325.1.200.1.3.2',
'pfStateTableInserts' => '.1.3.6.1.4.1.12325.1.200.1.3.3',
'pfStateTableRemovals' => '.1.3.6.1.4.1.12325.1.200.1.3.4',
);
......@@ -401,7 +404,7 @@ if (! $nodaemon ) {
close STDIN;
close STDOUT;
close STDERR;
open (STDIN, '/dev/null') or die("Can't read /dev/null: $!\n");
open (STDIN, '/dev/null') or die("Can't read /dev/null: $!\n");
if (defined($stdout) ) {
open(STDOUT,">> $stdout") or
die ("ERROR: Can't write to $stdout: $!\n");
......@@ -474,9 +477,9 @@ my $hostinfo_sql = 'select dh.snmp_location, dh.sysObjectID_id,
where dh.id = ?';
my $hostinfo_h = $db->prepare($hostinfo_sql);
my $sysObjectID_sql = 'select id
from dvg_sysObjectID
where sysObjectID = ?';
my $sysObjectID_sql = 'SELECT id
FROM dvg_sysObjectID
WHERE sysObjectID = ?';
my $sysObjectID_h = $db->prepare($sysObjectID_sql);
my $hicb_check_hwtype_sql = 'select sysObjectID_id
from dvg_host
......@@ -530,7 +533,6 @@ while ( $RUN ) {
} else {
$target = $hostname;
}
# TODO Check target if it's resolvable
$session = OpenSession($THIS_HOSTID, $target, $snmpdomain,
$snmpversion, $snmpcommunity, $username, $seclevel, $authkey,
......@@ -748,24 +750,23 @@ sub database_cb($$$) # {{{
# checke for hosts with a changed date
my $host_sql = "select dh.id, dh.name, dh.activ = 'y', dh.changed
from dvg_module dm, dvg_module_assign dma,
my $host_sql = "SELECT dh.id, dh.name, dh.activ = 'y', dh.changed
FROM dvg_module dm, dvg_module_assign dma,
dvg_host dh, dvg_device dd, dvg_probe dp
where dm.type = 'host'
and dm.name = 'device'
and dma.target_id = dh.id
/* and dh.activ = 'y' */
and dh.start_date <= curdate()
and (dh.stop_date is null or dh.stop_date >= curdate())
and dd.host_id = dh.id
and dd.activ = 'y'
and dd.start_date <= curdate()
and (dd.stop_date is null or dd.stop_date >= curdate())
and dd.probe_id = dp.id
and dp.type = 'snmp'
and dh.changed >= FROM_UNIXTIME(?)
group by dh.id";
WHERE dm.type = 'host'
AND dm.name = 'device'
AND dma.target_id = dh.id
/* AND dh.activ = 'y' */
AND dh.start_date <= curdate()
AND (dh.stop_date is null or dh.stop_date >= curdate())
AND dd.host_id = dh.id
AND dd.activ = 'y'
AND dd.start_date <= curdate()
AND (dd.stop_date is null or dd.stop_date >= curdate())
AND dd.probe_id = dp.id
AND dp.type = 'snmp'
AND dh.changed >= FROM_UNIXTIME(?)
GROUP BY dh.id";
my $host_h = $db->prepare($host_sql);
$host_h->execute($last_check);
......@@ -966,7 +967,7 @@ sub uptime_cb($$$) # {{{
if (defined($session->var_bind_list)) {
$uptime = $session->var_bind_list->{$SNMP_sysuptime};
$newhost_status = 'up';
if ($olduptime && ($uptime < $olduptime)) {
if (isint($uptime) && ($uptime < $olduptime)) {
Unix::Syslog::syslog (LOG_WARNING,
"U_CB: (%d;%s::0) has restarted; last uptime: %s",
$host_id, $session->hostname(), $olduptime);
......@@ -1124,17 +1125,21 @@ sub data_cb($$$$$$$@) # {{{
}
if ( $value_id > 0 ) {
$db->do(sprintf(
"update dvg_device_value
set last_sample = %s, delta_value = %s,
delta_time = %s, time = '%s' where id = '%s'",
if (defined($val) && defined($delta_value) && defined($delta_time) ) {
$db->do(sprintf(
"UPDATE dvg_device_value
SET last_sample = %s, delta_value = %s,
delta_time = %s, time = '%s' where id = '%s'",
$val,$delta_value,$delta_time,$now,$value_id));
}
} else {
$db->do(sprintf("insert delayed into
dvg_device_value(id,device_id,arg_id,last_sample,
delta_value,delta_time,time)
values(null,'%d','%d',%s,%s,%s,%s)",
$device_id,$n,$val,$delta_value,$delta_time,$now));
if (defined($val) && defined($delta_value) && defined($delta_time) ) {
$db->do(sprintf(
"INSERT DELAYED INTO dvg_device_value(id,device_id,
arg_id,last_sample,delta_value,delta_time,time)
VALUES(null,'%d','%d',%s,%s,%s,%s)",
$device_id,$n,$val,$delta_value,$delta_time,$now));
}
}
$n++;
}
......@@ -1261,7 +1266,7 @@ sub hostinfo_cb($$) # {{{
if( $hicb_hwid_h->execute($sysobjectid_id) ) {
my($count,$value) = $hicb_hwid_h->fetchrow;
if ( $count == 0 ) {
Unix::Syslog::syslog(LOG_INFO,"HI_CB: no hw-entry is matching the sysObjectID (host_id=%d)",$host_id);
Unix::Syslog::syslog(LOG_INFO,"HI_CB: no hw-entry is matching the sysObjectID(%s) (host_id=%d)",$sysobjectid_id, $host_id);
} elsif ( $count == 1) {
$db->do(sprintf('update dvg_host
set hw_id=\'%d\', changed=changed
......@@ -1463,18 +1468,19 @@ sub device2params($$$$$$) # {{{
my ($session,$device_id,$host_id,$target,$snmpversion,$hasHC) = @_;
my ($get_probe_args_h,$_probe_id, $parameter, $max_param_id, $min_param_id,
$probe_id, @dev_parameter, @PARAM_MAX, @PARAM_MIN, $param_id, $param, $value,
$max, @max, $min, @min, $absmax, $realmax, $datafile_name,
$dotraffic, $wrapnegative, $n,$i);
my ($_probe_id, $_probe_name, $absmax, $datafile_name, $dotraffic,
$get_probe_args_h, $max, $max_param_id, $min, $min_param_id, $param,
$param_id, $parameter, $probe_id, $probe_name, $realmax, $value,
$wrapnegative, @dev_parameter, @max, @min, @PARAM_MAX, @PARAM_MIN,
$n,$i);
my $get_probe_args_sql = 'select p.id, pa.oid, pa.max_param, null
from dvg_probe_args pa, dvg_probe p, dvg_device dd
where p.id = pa.probe_id
and p.type = \'snmp\'
and p.id = dd.probe_id
and dd.id = ?
order by pa.seq';
my $get_probe_args_sql = 'SELECT p.id, p.name, pa.oid, pa.max_param, null
FROM dvg_probe_args pa, dvg_probe p, dvg_device dd
WHERE p.id = pa.probe_id
AND p.type = \'snmp\'
AND p.id = dd.probe_id
AND dd.id = ?
ORDER BY pa.seq';
$get_probe_args_h = $db->prepare($get_probe_args_sql);
$get_probe_args_h->execute($device_id);
......@@ -1500,15 +1506,16 @@ sub device2params($$$$$$) # {{{
Unix::Syslog::syslog (LOG_INFO,"
d2p: ([%s;%d]::%s) %s parameter found",
$session->hostname(), $host_id, $device_id, $get_probe_args_count)
if $DEBUG;;
if $DEBUG;
}
@dev_parameter = @PARAM_MAX = @PARAM_MIN = ();
$n=0;
while ( ($_probe_id, $parameter, $max_param_id, $min_param_id) =
while ( ($_probe_id,$_probe_name,$parameter, $max_param_id, $min_param_id) =
$get_probe_args_h->fetchrow) {
$probe_id = $_probe_id;
$probe_name = $_probe_name;
$dev_parameter[$n] = $parameter;
$PARAM_MAX[$n] = $max_param_id;
$PARAM_MIN[$n] = $min_param_id;
......@@ -1538,7 +1545,7 @@ sub device2params($$$$$$) # {{{
$wrapnegative = $value;
}
for ($i=0; $i < $n; $i++) {
if ($PARAM_MAX[$i] == $param_id) {
if (defined($PARAM_MAX[$i]) && $PARAM_MAX[$i] == $param_id) {
$max[$i] = $value;
}
# TODO
......@@ -1548,10 +1555,16 @@ sub device2params($$$$$$) # {{{
}
# if $value starts with a # -> it is a Interfacename
if ( $value =~ /^#/i ) {
if ( $value =~ /^#/i && $probe_name =~ /^ifOctet/ ) {
$value = DVG_tool::get_intnum_byname($HOSTS{$host_id}{'session'},
$host_id,$device_id,$target,$value);
} elsif ($value eq '@IP' ) { # hack for the lucent pips
} elsif ( $value =~ /^#/i && $probe_name =~ /^iostat/ ) {
$value = DVG_tool::get_iodevice_byname($HOSTS{$host_id}{'session'},
$host_id,$device_id,$target,$value);
} elsif ( $value =~ /^#/i && $probe_name =~ /^Disk usage/ ) {
$value = DVG_tool::get_mountpath_byname($HOSTS{$host_id}{'session'},
$host_id,$device_id,$target,$value);
} elsif ( $value eq '@IP' ) { # hack for the lucent pips
$value = 0;
# search the IP Addresse ...
$ip_h->execute($device_id);
......
#!/usr/bin/perl -w
#
# Copyright (C) 2002 ... 2013 Ueli Heuer
# Copyright (c) Ueli Heuer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -16,7 +16,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# $Id$
# {{{ perldoc page
=head1 NAME
......
#!/usr/bin/perl -w
#
# Copyright (C) 2005 ... 2013 Ueli Heuer
# Copyright (c) Ueli Heuer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -16,7 +16,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# $Id$
# {{{ perldoc page
=head1 NAME
......
#!/usr/bin/perl -w
#
# Copyright (C) 2005 ... 2013 Ueli Heuer
# Copyright (c) Ueli Heuer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -16,7 +16,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# $Id$
# {{{ perldoc page
=head1 NAME
......
#!/usr/bin/perl -w
#
# Copyright (C) 2002 ... 2013 Ueli Heuer ueli@dvgtool.org
# Copyright (c) Ueli Heuer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -16,8 +16,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# $Id$
use FindBin;
use lib "$FindBin::RealBin/../lib";
use lib "$FindBin::RealBin/modules"; # plugins are here
......@@ -25,7 +23,8 @@ use DVG_config;
use DVG_tool;
#use strict;
use SNMP_util "0.86";
#use SNMP_util "0.86";
use Net::SNMP::Util;
use RRDs;
use vars qw($db);
......@@ -33,7 +32,7 @@ $db = db_connect('dvgdb','RW'); # connect RW to the database
DVG_tool::init($db);
my $BIN = get_bindir();
$SNMP_Session::suppress_warnings = 2 ; # we do not want any SNMP errormessages
#$SNMP_Session::suppress_warnings = 2 ; # we do not want any SNMP errormessages
# {{{ sub update_rrd ($@)
sub update_rrd ($@) {
......@@ -65,6 +64,15 @@ sub get_values ($$$@) {
@values = `$torun`;
} elsif ( $type eq 'module' ) {
($module, @param) = @parameter;
if ($module =~ /,/) {
($module,$param0) = split(/,/,$module,2);
if ($param0 =~ /^\"/) {
$param0 =~ s/^\"//;
}
}
if (defined($param0)) {
@param = $param0;
}
$param = sprintf('"%s"',join ('","',@param));
$mod_var = "${module}_mod";
if (! ${$mod_var} ) {
......@@ -78,7 +86,7 @@ sub get_values ($$$@) {
# }}}
# {{{ sub get_status($)
my $status_h = $db->prepare(
'select status
'SELECT status
from dvg_host_status
where host_id=?
order by last_changed desc limit 1');
......@@ -103,11 +111,11 @@ my ($error,$in,$out);
## check first what we should do ....
my ($todo,$probe_type_sql,$probe_type_h,$type,$arg,$n);
$todo = $ARGV[0];
$probe_type_sql = "select type from dvg_probe where type = ? and type != 'dummy' group by type";
$probe_type_sql = "SELECT type from dvg_probe where type = ? and type != 'dummy' group by type";
$probe_type_h = $db->prepare($probe_type_sql);
$probe_type_h->execute($todo);
if ( $probe_type_h->rows < 1 ) {
$probe_type_sql = "select type from dvg_probe where type != 'dummy' group by type";
$probe_type_sql = "SELECT type from dvg_probe where type != 'dummy' group by type";
$probe_type_h = $db->prepare($probe_type_sql);
$probe_type_h->execute();
$arg = '['; $n=1;
......@@ -122,7 +130,7 @@ if ( $probe_type_h->rows < 1 ) {
$parameters_sql = "
select dd.id, dp.id, dp.type, dh.id, dh.name, dh.host, community
SELECT dd.id, dp.id, dp.type, dh.id, dh.name, dh.host, community
from dvg_host_location hl,
dvg_host dh,
dvg_device dd,
......@@ -142,36 +150,42 @@ $parameter_h = $db->prepare($parameters_sql);
$parameter_h->execute($todo);
$parameter_count = $parameter_h->rows;
$get_params = "select pp.id,pp.param,ddp.value
from dvg_device_param ddp, dvg_probe_param pp
where pp.id = ddp.oid_param_id
and ddp.device_id = ?";
$get_params = "SELECT pp.id,pp.param,ddp.value
FROM dvg_device_param ddp, dvg_probe_param pp
WHERE pp.id = ddp.oid_param_id
AND ddp.device_id = ?";
$params_h = $db->prepare($get_params);
if ($parameter_count > 0 ) { # wenn es was zu tun gibt tun wir es
## cache the argument_table
my ($probe_args_sql,$probe_args_h,$probe_id,$seq,$oid,$oid_type,$max_param_id,@PROBE_ARGS);
$probe_args_sql = "select p.id,pa.seq,pa.oid,pa.max_param
from dvg_probe_args pa, dvg_probe p
where p.id=pa.probe_id
and p.type = ?
order by p.id,pa.seq";
$probe_args_sql = "SELECT p.id,pa.seq,pa.oid,pa.max_param
FROM dvg_probe_args pa, dvg_probe p
WHERE p.id=pa.probe_id
AND p.type = ?
ORDER BY p.id,pa.seq";
$probe_args_h = $db->prepare($probe_args_sql);
$probe_args_h->execute($todo);
while (($probe_id,$seq,$oid,$max_param_id) = $probe_args_h->fetchrow) {
@{$PROBE_ARGS[$probe_id]}[$seq] = [ ($oid,$max_param_id) ];
}
my $get_old_value_h = $db->prepare("select id,last_sample,delta_value,time from dvg_device_value where device_id = ? and arg_id = ?");
my $update_value_h = $db->prepare("update dvg_device_value set last_sample = ?, delta_value = ?, delta_time = ?, time = ? where id = ?");
my $insert_value_h = $db->prepare("insert into dvg_device_value(id,device_id,arg_id,last_sample,delta_value,delta_time,time) values(null,?,?,?,?,?,?)");
my $get_old_value_h = $db->prepare("SELECT id,last_sample,delta_value,time
FROM dvg_device_value
WHERE device_id = ? and arg_id = ?");
my $update_value_h = $db->prepare("UPDATE dvg_device_value
SET last_sample = ?, delta_value = ?, delta_time = ?, time = ? where id = ?");
my $insert_value_h = $db->prepare("INSERT
INTO dvg_device_value(id,device_id,arg_id,last_sample,delta_value,delta_time,time)
VALUES (null,?,?,?,?,?,?)");
undef @dev_parameter;
undef @max;
while (($device_id,$probe_id,$probe_type,$host_id,$hostname,$targethost,$community) = $parameter_h->fetchrow) {
while (($device_id,$probe_id,$probe_type,$host_id,$hostname,$targethost,$community) =
$parameter_h->fetchrow) {
if ( defined ($targethost) && $targethost ne '') {
$target = $targethost;
} else {
......@@ -231,7 +245,7 @@ if ($parameter_count > 0 ) { # wenn es was zu tun gibt tun wir es
$get_old_value_h->execute($device_id,$n);
if ( $get_old_value_h->rows == 1 ) {
($value_id,$old_value,$old_delta,$old_time) = $get_old_value_h->fetchrow;
if ( $val !~ /^U/i ) {
if ( $val !~ /^U/i && defined($old_value)) {
$delta_value = $val-$old_value;
$delta_time = time() - $old_time;
} else {
......@@ -242,7 +256,12 @@ if ($parameter_count > 0 ) { # wenn es was zu tun gibt tun wir es
$old_time = time();
}
if ( $value_id > 0 ) {
$update_value_h->execute($val,$delta_value,$delta_time,time(),$value_id);
if ($val eq 'U') {
$update_value_h->execute(undef,$delta_value,$delta_time,time(),$value_id)
} else {
$update_value_h->execute($val,$delta_value,$delta_time,time(),$value_id)
}