diff options
author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-05-15 18:53:33 +0000 |
---|---|---|
committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-05-15 18:53:33 +0000 |
commit | 20ff0332e4cebfb212300f3d9496f14e400a6234 (patch) | |
tree | 2e0cabe69c9bbc7ffca7d3b9783f788334f3cff2 | |
parent | f11bd43692bbd9c13e94cccad81eea4a92b7b06f (diff) | |
download | zabbix-20ff0332e4cebfb212300f3d9496f14e400a6234.tar.gz zabbix-20ff0332e4cebfb212300f3d9496f14e400a6234.tar.xz zabbix-20ff0332e4cebfb212300f3d9496f14e400a6234.zip |
- change copyright to SIA Zabbix (Alexei)
- added basic support for log[*] (Alexei)
- fixed processing of traps having character ':' (Alexei)
- added logfiles.h and logfiles.c (Alexei)
- group level start/stop monitoring (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@1774 97f52cf1-0a1b-0410-bd0e-c28be96e8082
119 files changed, 502 insertions, 297 deletions
@@ -1,5 +1,10 @@ Changes for 1.1alpha8: + - change copyright to SIA Zabbix (Alexei) + - added basic support for log[*] (Alexei) + - fixed processing of traps having character ':' (Alexei) + - added logfiles.h and logfiles.c (Alexei) + - group level start/stop monitoring (Alexei) - fixed read loop in active.c. (Alexei) - better readability of php code (Alexei) - support of file[*] (Alexei) diff --git a/configure.in b/configure.in index faa4829b..1d4fdc4e 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ dnl -dnl Zabbix -dnl Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +dnl ZABBIX +dnl Copyright (C) 2000-2005 SIA Zabbix dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by diff --git a/create/mysql/schema.sql b/create/mysql/schema.sql index 49bd8afe..7e1310b4 100644 --- a/create/mysql/schema.sql +++ b/create/mysql/schema.sql @@ -1,6 +1,6 @@ -- --- Zabbix --- Copyright (C) 2000,2001,2002,2003 Alexei Vladishev +-- ZABBIX +-- Copyright (C) 2000-2005 SIA Zabbix -- -- 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 @@ -416,7 +416,7 @@ CREATE TABLE audit ( resource int(4) DEFAULT '0' NOT NULL, details varchar(128) DEFAULT '0' NOT NULL, PRIMARY KEY (auditid), - UNIQUE (userid,clock), + KEY (userid,clock), KEY (clock) ) type=InnoDB; diff --git a/create/postgresql/schema.sql b/create/postgresql/schema.sql index 7ffc8715..a63680e8 100644 --- a/create/postgresql/schema.sql +++ b/create/postgresql/schema.sql @@ -1,6 +1,6 @@ -- --- Zabbix --- Copyright (C) 2000,2001,2002,2003 Alexei Vladishev +-- ZABBIX +-- Copyright (C) 2000-2005 SIA Zabbix -- -- 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 @@ -186,7 +186,7 @@ CREATE TABLE audit ( PRIMARY KEY (auditid) ); -CREATE UNIQUE INDEX audit_userid_clock on audit (userid,clock); +CREATE INDEX audit_userid_clock on audit (userid,clock); CREATE INDEX audit_clock on audit (clock); -- diff --git a/frontends/php/about.php b/frontends/php/about.php index d401c152..b2fd48ac 100644 --- a/frontends/php/about.php +++ b/frontends/php/about.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/actions.php b/frontends/php/actions.php index ad633ffd..d6fc1ce0 100644 --- a/frontends/php/actions.php +++ b/frontends/php/actions.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/alarms.php b/frontends/php/alarms.php index 7d603f7d..95a46f0a 100644 --- a/frontends/php/alarms.php +++ b/frontends/php/alarms.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/alerts.php b/frontends/php/alerts.php index 010a2e54..df6e6995 100644 --- a/frontends/php/alerts.php +++ b/frontends/php/alerts.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/audit.php b/frontends/php/audit.php index dd5c64f3..faab3505 100644 --- a/frontends/php/audit.php +++ b/frontends/php/audit.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/chart.php b/frontends/php/chart.php index 099d6306..98249948 100644 --- a/frontends/php/chart.php +++ b/frontends/php/chart.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/chart2.php b/frontends/php/chart2.php index deba7a41..86233ac4 100644 --- a/frontends/php/chart2.php +++ b/frontends/php/chart2.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/chart4.php b/frontends/php/chart4.php index bc9de8d9..348cb7fc 100644 --- a/frontends/php/chart4.php +++ b/frontends/php/chart4.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/chart5.php b/frontends/php/chart5.php index 574a3b5b..e31fe341 100644 --- a/frontends/php/chart5.php +++ b/frontends/php/chart5.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/chart_diff.php b/frontends/php/chart_diff.php index 1c5db867..e3009446 100644 --- a/frontends/php/chart_diff.php +++ b/frontends/php/chart_diff.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/chart_sla.php b/frontends/php/chart_sla.php index 003a4c58..e1a5f109 100644 --- a/frontends/php/chart_sla.php +++ b/frontends/php/chart_sla.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/charts.php b/frontends/php/charts.php index 73e0ab94..38cb86a2 100644 --- a/frontends/php/charts.php +++ b/frontends/php/charts.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/config.php b/frontends/php/config.php index 33897e08..ba37de0c 100644 --- a/frontends/php/config.php +++ b/frontends/php/config.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/graph.php b/frontends/php/graph.php index 8c469957..0d83cab8 100644 --- a/frontends/php/graph.php +++ b/frontends/php/graph.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/graphs.php b/frontends/php/graphs.php index 16df601f..d68d80e5 100644 --- a/frontends/php/graphs.php +++ b/frontends/php/graphs.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/history.php b/frontends/php/history.php index 9883a610..15cf54d1 100644 --- a/frontends/php/history.php +++ b/frontends/php/history.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 @@ -151,7 +151,7 @@ echo "<TABLE BORDER=0 COLS=2 ALIGN=CENTER WIDTH=100% BGCOLOR=\"#AAAAAA\" cellspacing=1 cellpadding=3>"; echo "<TR BGCOLOR=\"#CCCCCC\">"; - echo "<TD><B>".S_CLOCK."</B></TD>"; + echo "<TD><B>".S_TIMESTAMP."</B></TD>"; echo "<TD><B>".S_VALUE."</B></TD>"; echo "</TR>"; diff --git a/frontends/php/hosts.php b/frontends/php/hosts.php index 9af83aba..9ef49f42 100644 --- a/frontends/php/hosts.php +++ b/frontends/php/hosts.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 @@ -173,6 +173,32 @@ $result=update_host_group($_GET["groupid"], $_GET["name"], $_GET["hosts"]); show_messages($result, S_GROUP_UPDATED, _S_CANNOT_UPDATE_GROUP); } + if($_GET["register"]=="start monitoring") + { + $result=DBselect("select hostid from hosts_groups where groupid=".$_GET["groupid"]); + while($row=DBfetch($result)) + { + $res=update_host_status($row["hostid"],HOST_STATUS_MONITORED); + if($res) + { + add_audit(AUDIT_ACTION_UPDATE,AUDIT_RESOURCE_HOST,"New status [".HOST_STATUS_MONITORED."]"); + } + } + show_messages(1,S_HOST_STATUS_UPDATED,S_CANNOT_UPDATE_HOST_STATUS); + } + if($_GET["register"]=="stop monitoring") + { + $result=DBselect("select hostid from hosts_groups where groupid=".$_GET["groupid"]); + while($row=DBfetch($result)) + { + $res=update_host_status($row["hostid"],HOST_STATUS_NOT_MONITORED); + if($res) + { + add_audit(AUDIT_ACTION_UPDATE,AUDIT_RESOURCE_HOST,"New status [".HOST_STATUS_NOT_MONITORED."]"); + } + } + show_messages(1,S_HOST_STATUS_UPDATED,S_CANNOT_UPDATE_HOST_STATUS); + } } ?> diff --git a/frontends/php/image.php b/frontends/php/image.php index 335da4f2..25a3b73b 100644 --- a/frontends/php/image.php +++ b/frontends/php/image.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/include/actions.inc.php b/frontends/php/include/actions.inc.php index b808a249..d6e403a1 100644 --- a/frontends/php/include/actions.inc.php +++ b/frontends/php/include/actions.inc.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/include/audit.inc.php b/frontends/php/include/audit.inc.php index 3f7a6b26..5364e121 100644 --- a/frontends/php/include/audit.inc.php +++ b/frontends/php/include/audit.inc.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/include/classes.inc.php b/frontends/php/include/classes.inc.php index 1655eea0..e5ce1aaf 100644 --- a/frontends/php/include/classes.inc.php +++ b/frontends/php/include/classes.inc.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index a8e41003..01ac0326 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 @@ -1439,31 +1439,6 @@ echo "</head>"; return $exp; } - # Update Host status - - function update_host_status($hostid,$status) - { - if(!check_right("Host","U",0)) - { - error("Insufficient permissions"); - return 0; - } - - $sql="select status from hosts where hostid=$hostid"; - $result=DBselect($sql); - $old_status=DBget_field($result,0,0); - if($status != $old_status) - { - update_trigger_value_to_unknown_by_hostid($hostid); - $sql="update hosts set status=$status where hostid=$hostid and status!=".HOST_STATUS_DELETED; - return DBexecute($sql); - } - else - { - return 1; - } - } - function add_image($name,$imagetype,$files) { if(isset($files)) @@ -2592,7 +2567,7 @@ echo "</head>"; <p> <table class="menu" width="100%" cellspacing=0 cellpadding=5> <tr> -<td class="horizontal_menu" height=24 colspan=9 align=center><b><?php echo "<a href=\"http://www.zabbix.com\" class=\"highlight\">".S_ZABBIX_VER."</a> ".S_COPYRIGHT_BY."<a href=\"mailto:alex@gobbo.caves.lv\" class=\"highlight\">".S_ALEXEI_VLADISHEV."</a>"; ?></b></td> +<td class="horizontal_menu" height=24 colspan=9 align=center><b><?php echo "<a href=\"http://www.zabbix.com\" class=\"highlight\">".S_ZABBIX_VER."</a> ".S_COPYRIGHT_BY."<a href=\"mailto:alex@gobbo.caves.lv\" class=\"highlight\">".S_SIA_ZABBIX."</a>"; ?></b></td> <td class="horizontal_menu" height=24 colspan=9 align=right><b><span class="divider"> | </span><?php echo " ".S_CONNECTED_AS." ".$USER_DETAILS["alias"];?></b></td> </tr> </table> diff --git a/frontends/php/include/db.inc.php b/frontends/php/include/db.inc.php index 694d7de1..2a9dd3da 100644 --- a/frontends/php/include/db.inc.php +++ b/frontends/php/include/db.inc.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/include/defines.inc.php b/frontends/php/include/defines.inc.php index f294e85c..636bd68c 100644 --- a/frontends/php/include/defines.inc.php +++ b/frontends/php/include/defines.inc.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php index cb5722ab..fef7db5c 100644 --- a/frontends/php/include/forms.inc.php +++ b/frontends/php/include/forms.inc.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 @@ -607,6 +607,8 @@ { echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"update group\">"; echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"delete group\" onClick=\"return Confirm('Delete selected group?');\">"; + echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"start monitoring\">"; + echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"stop monitoring\">"; } echo "</form>"; show_table2_header_end(); diff --git a/frontends/php/include/graphs.inc.php b/frontends/php/include/graphs.inc.php index 158d2ac5..7b07bdb3 100644 --- a/frontends/php/include/graphs.inc.php +++ b/frontends/php/include/graphs.inc.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/include/hosts.inc.php b/frontends/php/include/hosts.inc.php index f1e399f9..67a1bd8a 100644 --- a/frontends/php/include/hosts.inc.php +++ b/frontends/php/include/hosts.inc.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 @@ -199,4 +199,30 @@ } return $host; } + + # Update Host status + + function update_host_status($hostid,$status) + { + if(!check_right("Host","U",0)) + { + error("Insufficient permissions"); + return 0; + } + + $sql="select status,host from hosts where hostid=$hostid"; + $result=DBselect($sql); + $old_status=DBget_field($result,0,0); + if($status != $old_status) + { + update_trigger_value_to_unknown_by_hostid($hostid); + $sql="update hosts set status=$status where hostid=$hostid and status!=".HOST_STATUS_DELETED; + info("Updated status of host ".DBget_field($result,0,1)); + return DBexecute($sql); + } + else + { + return 1; + } + } ?> diff --git a/frontends/php/include/html.inc.php b/frontends/php/include/html.inc.php index 4c1b70d1..b40b10f9 100644 --- a/frontends/php/include/html.inc.php +++ b/frontends/php/include/html.inc.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/include/items.inc.php b/frontends/php/include/items.inc.php index 652688f2..348f38fd 100644 --- a/frontends/php/include/items.inc.php +++ b/frontends/php/include/items.inc.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 @@ -62,6 +62,10 @@ $sql="insert into items (description,key_,hostid,delay,history,nextcheck,status,type,snmp_community,snmp_oid,value_type,trapper_hosts,snmp_port,units,multiplier,delta,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,formula,trends) values ('$description','$key',$hostid,$delay,$history,0,$status,$type,'$snmp_community','$snmp_oid',$value_type,'$trapper_hosts',$snmp_port,'$units',$multiplier,$delta,'$snmpv3_securityname',$snmpv3_securitylevel,'$snmpv3_authpassphrase','$snmpv3_privpassphrase','$formula',$trends)"; $result=DBexecute($sql); + if($result) + { + info("Added new item $key"); + } return DBinsert_id($result,"items","itemid"); } @@ -115,7 +119,12 @@ $snmpv3_privpassphrase=addslashes($snmpv3_privpassphrase); $sql="update items set description='$description',key_='$key',hostid=$hostid,delay=$delay,history=$history,nextcheck=0,status=$status,type=$type,snmp_community='$snmp_community',snmp_oid='$snmp_oid',value_type=$value_type,trapper_hosts='$trapper_hosts',snmp_port=$snmp_port,units='$units',multiplier=$multiplier,delta=$delta,snmpv3_securityname='$snmpv3_securityname',snmpv3_securitylevel=$snmpv3_securitylevel,snmpv3_authpassphrase='$snmpv3_authpassphrase',snmpv3_privpassphrase='$snmpv3_privpassphrase',formula='$formula',trends=$trends where itemid=$itemid"; - return DBexecute($sql); + $result=DBexecute($sql); + if($result) + { + info("Item $key updated"); + } + return $result; } # Add item to hardlinked hosts @@ -253,6 +262,11 @@ return $result; } $sql="delete from items where itemid=$itemid"; - return DBexecute($sql); + $result=DBexecute($sql); + if($result) + { + info("Item $key deleted"); + } + return $result; } ?> diff --git a/frontends/php/include/local_en.inc.php b/frontends/php/include/local_en.inc.php index bfc1b702..9bd60943 100644 --- a/frontends/php/include/local_en.inc.php +++ b/frontends/php/include/local_en.inc.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 @@ -195,7 +195,7 @@ define("S_ZABBIX_VER", "ZABBIX 1.1alpha8"); define("S_COPYRIGHT_BY", "Copyright 2001-2005 by "); define("S_CONNECTED_AS", "Connected as"); - define("S_ALEXEI_VLADISHEV", "Alexei Vladishev"); + define("S_SIA_ZABBIX", "SIA Zabbix"); // graph.php define("S_CONFIGURATION_OF_GRAPH", "Configuration of graph"); @@ -237,7 +237,7 @@ define("S_VALUES_OF_LAST_HOUR", "Values of last hour"); define("S_VALUES_OF_SPECIFIED_PERIOD", "Values of specified period"); define("S_VALUES_IN_PLAIN_TEXT_FORMAT", "Values in plain text format"); - define("S_CLOCK", "Clock"); + define("S_TIMESTAMP", "Timestamp"); // hosts.php define("S_HOSTS", "Hosts"); diff --git a/frontends/php/include/maps.inc.php b/frontends/php/include/maps.inc.php index 0b0a758a..08fdc2c8 100644 --- a/frontends/php/include/maps.inc.php +++ b/frontends/php/include/maps.inc.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/include/screens.inc.php b/frontends/php/include/screens.inc.php index 688e950b..1439e45e 100644 --- a/frontends/php/include/screens.inc.php +++ b/frontends/php/include/screens.inc.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/include/services.inc.php b/frontends/php/include/services.inc.php index 9c9af979..23e68379 100644 --- a/frontends/php/include/services.inc.php +++ b/frontends/php/include/services.inc.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/include/triggers.inc.php b/frontends/php/include/triggers.inc.php index 415c5cf9..f316517a 100644 --- a/frontends/php/include/triggers.inc.php +++ b/frontends/php/include/triggers.inc.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/include/users.inc.php b/frontends/php/include/users.inc.php index a6495424..9012f2de 100644 --- a/frontends/php/include/users.inc.php +++ b/frontends/php/include/users.inc.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/index.php b/frontends/php/index.php index c1513b77..84e1ba74 100644 --- a/frontends/php/index.php +++ b/frontends/php/index.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/items.php b/frontends/php/items.php index 47f6e8aa..c622d845 100644 --- a/frontends/php/items.php +++ b/frontends/php/items.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/latest.php b/frontends/php/latest.php index b673764e..b693a645 100644 --- a/frontends/php/latest.php +++ b/frontends/php/latest.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/latestalarms.php b/frontends/php/latestalarms.php index b5595d8b..03cdf7a9 100644 --- a/frontends/php/latestalarms.php +++ b/frontends/php/latestalarms.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/map.php b/frontends/php/map.php index 6e102f41..35f930e6 100644 --- a/frontends/php/map.php +++ b/frontends/php/map.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/maps.php b/frontends/php/maps.php index 444daf20..236703d0 100644 --- a/frontends/php/maps.php +++ b/frontends/php/maps.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/media.php b/frontends/php/media.php index 56f50ae0..e68cdb41 100644 --- a/frontends/php/media.php +++ b/frontends/php/media.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/overview.php b/frontends/php/overview.php index 1dccf2e2..61f1a0ca 100644 --- a/frontends/php/overview.php +++ b/frontends/php/overview.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/queue.php b/frontends/php/queue.php index 08294e3b..7992689f 100644 --- a/frontends/php/queue.php +++ b/frontends/php/queue.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/report1.php b/frontends/php/report1.php index 59954535..2c192f08 100644 --- a/frontends/php/report1.php +++ b/frontends/php/report1.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/report2.php b/frontends/php/report2.php index 6bd5892c..6e7d47f6 100644 --- a/frontends/php/report2.php +++ b/frontends/php/report2.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/report3.php b/frontends/php/report3.php index 16b5546a..c0d6123a 100644 --- a/frontends/php/report3.php +++ b/frontends/php/report3.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/screenconf.php b/frontends/php/screenconf.php index 9a50bf84..a138a8b4 100644 --- a/frontends/php/screenconf.php +++ b/frontends/php/screenconf.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/screenedit.php b/frontends/php/screenedit.php index 47e9aeab..1fa1ebb3 100644 --- a/frontends/php/screenedit.php +++ b/frontends/php/screenedit.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/screens.php b/frontends/php/screens.php index bd3f33dd..7799a665 100644 --- a/frontends/php/screens.php +++ b/frontends/php/screens.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/services.php b/frontends/php/services.php index 73487f5a..3057bd88 100644 --- a/frontends/php/services.php +++ b/frontends/php/services.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/srv_status.php b/frontends/php/srv_status.php index fb0a391d..2df5688c 100644 --- a/frontends/php/srv_status.php +++ b/frontends/php/srv_status.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/sysmap.php b/frontends/php/sysmap.php index df4bc886..2fb33830 100644 --- a/frontends/php/sysmap.php +++ b/frontends/php/sysmap.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/sysmaps.php b/frontends/php/sysmaps.php index 7e4d9c7c..87655063 100644 --- a/frontends/php/sysmaps.php +++ b/frontends/php/sysmaps.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/tr_comments.php b/frontends/php/tr_comments.php index 803cba2e..86488de4 100644 --- a/frontends/php/tr_comments.php +++ b/frontends/php/tr_comments.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/tr_status.php b/frontends/php/tr_status.php index f5063a30..6477a550 100644 --- a/frontends/php/tr_status.php +++ b/frontends/php/tr_status.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/triggers.php b/frontends/php/triggers.php index 0f573e11..63b381d4 100644 --- a/frontends/php/triggers.php +++ b/frontends/php/triggers.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/frontends/php/users.php b/frontends/php/users.php index c5ff8929..bd16b2af 100644 --- a/frontends/php/users.php +++ b/frontends/php/users.php @@ -1,7 +1,7 @@ <?php /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/include/cfg.c b/include/cfg.c index bb87b46d..f2ab375d 100644 --- a/include/cfg.c +++ b/include/cfg.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/include/cfg.h b/include/cfg.h index 5eed2924..f46682cb 100644 --- a/include/cfg.h +++ b/include/cfg.h @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/include/common.h b/include/common.h index 7cb3d9e0..e4a71f77 100644 --- a/include/common.h +++ b/include/common.h @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/include/db.c b/include/db.c index cf946576..f774558c 100644 --- a/include/db.c +++ b/include/db.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/include/db.h b/include/db.h index a6fd7316..37ee2ad5 100644 --- a/include/db.h +++ b/include/db.h @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/include/email.c b/include/email.c index ef200fef..9dddbf51 100644 --- a/include/email.c +++ b/include/email.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/include/email.h b/include/email.h index 2b7cabac..026b2852 100644 --- a/include/email.h +++ b/include/email.h @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/include/expression.c b/include/expression.c index 835accb1..4713b5f0 100644 --- a/include/expression.c +++ b/include/expression.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/include/expression.h b/include/expression.h index 3166844c..c5340b4b 100644 --- a/include/expression.h +++ b/include/expression.h @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/include/functions.c b/include/functions.c index 43a663d3..bc917cb7 100644 --- a/include/functions.c +++ b/include/functions.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/include/functions.h b/include/functions.h index 1100259e..e4bfd734 100644 --- a/include/functions.h +++ b/include/functions.h @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/include/log.c b/include/log.c index 927c1a63..397d8ee5 100644 --- a/include/log.c +++ b/include/log.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/include/log.h b/include/log.h index af7a3b90..441e0929 100644 --- a/include/log.h +++ b/include/log.h @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/include/pid.c b/include/pid.c index 50f25139..27b39fab 100644 --- a/include/pid.c +++ b/include/pid.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/include/pid.h b/include/pid.h index b1653e2a..a39a66c9 100644 --- a/include/pid.h +++ b/include/pid.h @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/include/security.c b/include/security.c index eb9f8718..5493bbab 100644 --- a/include/security.c +++ b/include/security.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/include/security.h b/include/security.h index bef5b04f..09bd313d 100644 --- a/include/security.h +++ b/include/security.h @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/include/zlog.c b/include/zlog.c index 3eb3b1e4..b22e4c64 100644 --- a/include/zlog.c +++ b/include/zlog.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/include/zlog.h b/include/zlog.h index 2dd59956..2e140965 100644 --- a/include/zlog.h +++ b/include/zlog.h @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_agent/Makefile.in b/src/zabbix_agent/Makefile.in index f7f20890..39425ce3 100644 --- a/src/zabbix_agent/Makefile.in +++ b/src/zabbix_agent/Makefile.in @@ -5,7 +5,7 @@ LIBS = @LIBS@ @LDAP_LFLAGS@ all: @CC@ -o ../../bin/zabbix_agent @CFLAGS@ -I../../include zabbix_agent.c sysinfo.c ../../include/log.c ../../include/cfg.c ../../include/security.c ../../include/snprintf.c ../../include/md5.c -Wall $(LIBS) - @CC@ -o ../../bin/zabbix_agentd @CFLAGS@ -I../../include zabbix_agentd.c sysinfo.c stats.c interfaces.c diskdevices.c cpustat.c active.c ../../include/log.c ../../include/cfg.c ../../include/security.c ../../include/pid.c ../../include/snprintf.c ../../include/md5.c -Wall $(LIBS) + @CC@ -o ../../bin/zabbix_agentd @CFLAGS@ -I../../include zabbix_agentd.c logfiles.c sysinfo.c stats.c interfaces.c diskdevices.c cpustat.c active.c ../../include/log.c ../../include/cfg.c ../../include/security.c ../../include/pid.c ../../include/snprintf.c ../../include/md5.c -Wall $(LIBS) clean: rm -f *.o diff --git a/src/zabbix_agent/active.c b/src/zabbix_agent/active.c index 80998249..bf81a4fa 100644 --- a/src/zabbix_agent/active.c +++ b/src/zabbix_agent/active.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 @@ -58,6 +58,7 @@ #include "cfg.h" #include "stats.h" #include "active.h" +#include "logfiles.h" METRIC *metrics=NULL; @@ -72,29 +73,20 @@ void init_list() } else { - zabbix_log( LOG_LEVEL_DEBUG, "Metrics are already initialised"); + zabbix_log( LOG_LEVEL_WARNING, "Metrics are already initialised"); } } -void delete_all_metrics() +void disable_all_metrics() { - int i,count=0; + int i; zabbix_log( LOG_LEVEL_DEBUG, "In delete_all_metrics()"); for(i=0;;i++) { if(metrics[i].key == NULL) break; - count++; + metrics[i].status = ITEM_STATUS_NOTSUPPORTED; } - - for(i=count-1;i>=0;i--) - { - free(metrics[i].key); - } - free(metrics); - - metrics=NULL; - init_list(); } int get_min_nextcheck() @@ -123,23 +115,34 @@ int get_min_nextcheck() void add_check(char *key, int refresh) { - int i; + zabbix_log( LOG_LEVEL_DEBUG, "In add check [%s]", key); + for(i=0;;i++) { if(metrics[i].key == NULL) { - metrics[i].key=strdup(key); metrics[i].refresh=refresh; metrics[i].nextcheck=0; metrics[i].status=ITEM_STATUS_ACTIVE; + metrics[i].lastlogsize=0; metrics=realloc(metrics,(i+2)*sizeof(METRIC)); metrics[i+1].key=NULL; break; } + else if(strcmp(metrics[i].key,key)==0) + { + if(metrics[i].refresh!=refresh) + { + metrics[i].nextcheck=0; + } + metrics[i].refresh=refresh; + metrics[i].status=ITEM_STATUS_ACTIVE; + break; + } } } @@ -150,8 +153,7 @@ int parse_list_of_checks(char *str) char *key, *refresh; char *s1, *s2; - init_list(); - delete_all_metrics(); + disable_all_metrics(); line=(char *)strtok_r(str,"\n",&s1); while(line!=NULL) @@ -377,10 +379,12 @@ int send_value(char *server,int port,char *shortname,char *value) int process_active_checks(char *server, int port) { char value[MAX_STRING_LEN]; - int i, now; + int i, now, count; int ret = SUCCEED; char shortname[MAX_STRING_LEN]; + char c[MAX_STRING_LEN]; + char *filename; now=time(NULL); @@ -390,20 +394,52 @@ int process_active_checks(char *server, int port) if(metrics[i].nextcheck>now) continue; if(metrics[i].status!=ITEM_STATUS_ACTIVE) continue; - process(metrics[i].key, value); - - snprintf(shortname, MAX_STRING_LEN-1,"%s:%s",CONFIG_HOSTNAME,metrics[i].key); - zabbix_log( LOG_LEVEL_DEBUG, "%s",shortname); - if(send_value(server,port,shortname,value) == FAIL) + /* Special processing for log files */ + if(strncmp(metrics[i].key,"log[",4) == 0) { - ret = FAIL; - break; - } + strscpy(c,metrics[i].key); + filename=strtok(c,"[]"); + filename=strtok(NULL,"[]"); - if(strcmp(value,"ZBX_NOTSUPPORTED\n")==0) + count=0; + while(process_log(filename,metrics[i].lastlogsize,value) == 0) + { + snprintf(shortname, MAX_STRING_LEN-1,"%s:%s",CONFIG_HOSTNAME,metrics[i].key); + zabbix_log( LOG_LEVEL_DEBUG, "%s",shortname); + if(send_value(server,port,shortname,value) == FAIL) + { + ret = FAIL; + break; + } + if(strcmp(value,"ZBX_NOTSUPPORTED\n")==0) + { + metrics[i].status=ITEM_STATUS_NOTSUPPORTED; + zabbix_log( LOG_LEVEL_WARNING, "Active check [%s] is not supported. Disabled.", metrics[i].key); + break; + } + metrics[i].lastlogsize+=strlen(value); + count++; + /* Do not flood ZABBIX server if file grows too fast */ + if(count >= MAX_LINES_PER_SECOND*metrics[i].refresh) break; + } + } + else { - metrics[i].status=ITEM_STATUS_NOTSUPPORTED; - zabbix_log( LOG_LEVEL_WARNING, "Active check [%s] is not supported. Disabled.", metrics[i].key); + process(metrics[i].key, value); + + snprintf(shortname, MAX_STRING_LEN-1,"%s:%s",CONFIG_HOSTNAME,metrics[i].key); + zabbix_log( LOG_LEVEL_DEBUG, "%s",shortname); + if(send_value(server,port,shortname,value) == FAIL) + { + ret = FAIL; + break; + } + + if(strcmp(value,"ZBX_NOTSUPPORTED\n")==0) + { + metrics[i].status=ITEM_STATUS_NOTSUPPORTED; + zabbix_log( LOG_LEVEL_WARNING, "Active check [%s] is not supported. Disabled.", metrics[i].key); + } } metrics[i].nextcheck=time(NULL)+metrics[i].refresh; @@ -437,6 +473,8 @@ void child_active_main(int i,char *server, int port) setproctitle("getting list of active checks"); #endif + init_list(); + refresh_metrics(server, port, error, sizeof(error)); nextrefresh=time(NULL)+CONFIG_REFRESH_ACTIVE_CHECKS; diff --git a/src/zabbix_agent/active.h b/src/zabbix_agent/active.h index dd2729e9..39e33dcf 100644 --- a/src/zabbix_agent/active.h +++ b/src/zabbix_agent/active.h @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 @@ -23,6 +23,8 @@ extern char *CONFIG_HOSTNAME; extern int CONFIG_REFRESH_ACTIVE_CHECKS; +#define MAX_LINES_PER_SECOND 10 + #define METRIC struct metric_type METRIC { @@ -30,6 +32,7 @@ METRIC int refresh; int nextcheck; int status; + int lastlogsize; }; pid_t child_active_make(int i,char *server, int port); diff --git a/src/zabbix_agent/cpustat.c b/src/zabbix_agent/cpustat.c index 0579fd33..ec4980f2 100644 --- a/src/zabbix_agent/cpustat.c +++ b/src/zabbix_agent/cpustat.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_agent/cpustat.h b/src/zabbix_agent/cpustat.h index a6da0c85..af2a72b1 100644 --- a/src/zabbix_agent/cpustat.h +++ b/src/zabbix_agent/cpustat.h @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_agent/diskdevices.c b/src/zabbix_agent/diskdevices.c index 452cf211..3f80543b 100644 --- a/src/zabbix_agent/diskdevices.c +++ b/src/zabbix_agent/diskdevices.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_agent/diskdevices.h b/src/zabbix_agent/diskdevices.h index 0a873bbb..a8d28704 100644 --- a/src/zabbix_agent/diskdevices.h +++ b/src/zabbix_agent/diskdevices.h @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_agent/interfaces.c b/src/zabbix_agent/interfaces.c index 1ed74d96..f4748415 100644 --- a/src/zabbix_agent/interfaces.c +++ b/src/zabbix_agent/interfaces.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_agent/interfaces.h b/src/zabbix_agent/interfaces.h index 800b3c50..75eb723f 100644 --- a/src/zabbix_agent/interfaces.h +++ b/src/zabbix_agent/interfaces.h @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_agent/logfiles.c b/src/zabbix_agent/logfiles.c new file mode 100644 index 00000000..a71c97cf --- /dev/null +++ b/src/zabbix_agent/logfiles.c @@ -0,0 +1,83 @@ +/* +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix +** +** 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 +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +**/ + +#include "config.h" + +#include <errno.h> +#include <stdio.h> +#include <string.h> + +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> + +#include "common.h" + +#include "log.h" +#include "logfiles.h" + +int process_log(char *filename,int lastlogsize, char *value) +{ + FILE *f; + struct stat buf; + + zabbix_log( LOG_LEVEL_WARNING, "In process log (%s,%d)", filename, lastlogsize); + + /* Handling of file shrinking */ + if(stat(filename,&buf) == 0) + { + NOT SUPPORTED YET + if(buf.st_size<lastlogsize) + { + lastlogsize=0; + } + } + else + { + zabbix_log( LOG_LEVEL_WARNING, "Cannot open [%s] [%s]", filename, strerror(errno)); + snprintf(value,MAX_STRING_LEN-1,"%s","ZBX_NOTSUPPORTED\n"); + return 1; + } + + f=fopen(filename,"r"); + if(NULL == f) + { + zabbix_log( LOG_LEVEL_WARNING, "Cannot open [%s] [%s]", filename, strerror(errno)); + snprintf(value,MAX_STRING_LEN-1,"%s","ZBX_NOTSUPPORTED\n"); + return 1; + } + + if(-1 == fseek(f,lastlogsize,SEEK_SET)) + { + zabbix_log( LOG_LEVEL_WARNING, "Cannot set postition to [%d] for [%s] [%s]", lastlogsize, filename, strerror(errno)); + snprintf(value,MAX_STRING_LEN-1,"%s","ZBX_NOTSUPPORTED\n"); + fclose(f); + return 1; + } + + if(NULL == fgets(value, MAX_STRING_LEN-1, f)) + { + /* EOF */ + fclose(f); + return 1; + } + fclose(f); + + return 0; +} diff --git a/src/zabbix_agent/logfiles.h b/src/zabbix_agent/logfiles.h new file mode 100644 index 00000000..dc4381d2 --- /dev/null +++ b/src/zabbix_agent/logfiles.h @@ -0,0 +1,25 @@ +/* +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix +** +** 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 +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +**/ + +#ifndef ZABBIX_LOGFILES_H +#define ZABBIX_LOGFILES_H + +int process_log(char *filename,int lastlogsize, char *value); + +#endif diff --git a/src/zabbix_agent/stats.c b/src/zabbix_agent/stats.c index a18dfb27..b5be51fb 100644 --- a/src/zabbix_agent/stats.c +++ b/src/zabbix_agent/stats.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_agent/stats.h b/src/zabbix_agent/stats.h index b449c5c0..ddd01bab 100644 --- a/src/zabbix_agent/stats.h +++ b/src/zabbix_agent/stats.h @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_agent/sysinfo.c b/src/zabbix_agent/sysinfo.c index 99c57465..9a220ac9 100644 --- a/src/zabbix_agent/sysinfo.c +++ b/src/zabbix_agent/sysinfo.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_agent/sysinfo.h b/src/zabbix_agent/sysinfo.h index 89034389..ed118bd7 100644 --- a/src/zabbix_agent/sysinfo.h +++ b/src/zabbix_agent/sysinfo.h @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_agent/zabbix_agent.c b/src/zabbix_agent/zabbix_agent.c index f72b3a2b..437e7b6b 100644 --- a/src/zabbix_agent/zabbix_agent.c +++ b/src/zabbix_agent/zabbix_agent.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_agent/zabbix_agent.h b/src/zabbix_agent/zabbix_agent.h index 28a942d6..3f5ab9c9 100644 --- a/src/zabbix_agent/zabbix_agent.h +++ b/src/zabbix_agent/zabbix_agent.h @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_agent/zabbix_agentd.c b/src/zabbix_agent/zabbix_agentd.c index e7911aaf..f16c38e4 100644 --- a/src/zabbix_agent/zabbix_agentd.c +++ b/src/zabbix_agent/zabbix_agentd.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_sender/zabbix_sender.c b/src/zabbix_sender/zabbix_sender.c index 4d6e2847..5c8d700b 100644 --- a/src/zabbix_sender/zabbix_sender.c +++ b/src/zabbix_sender/zabbix_sender.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_server/alerter.c b/src/zabbix_server/alerter.c index 0fbb3da7..5b1ffb58 100644 --- a/src/zabbix_server/alerter.c +++ b/src/zabbix_server/alerter.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_server/alerter.h b/src/zabbix_server/alerter.h index 272a78aa..52a0a621 100644 --- a/src/zabbix_server/alerter.h +++ b/src/zabbix_server/alerter.h @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_server/calculator.c b/src/zabbix_server/calculator.c index 29ffdc5f..0433b7c4 100644 --- a/src/zabbix_server/calculator.c +++ b/src/zabbix_server/calculator.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_server/calculator.h b/src/zabbix_server/calculator.h index 53c04ea8..5dad8723 100644 --- a/src/zabbix_server/calculator.h +++ b/src/zabbix_server/calculator.h @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_server/checks_agent.c b/src/zabbix_server/checks_agent.c index 593ef977..d279e1e4 100644 --- a/src/zabbix_server/checks_agent.c +++ b/src/zabbix_server/checks_agent.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_server/checks_agent.h b/src/zabbix_server/checks_agent.h index ffe3270b..0d7bae18 100644 --- a/src/zabbix_server/checks_agent.h +++ b/src/zabbix_server/checks_agent.h @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_server/checks_internal.c b/src/zabbix_server/checks_internal.c index a7b4f5ff..0140f795 100644 --- a/src/zabbix_server/checks_internal.c +++ b/src/zabbix_server/checks_internal.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_server/checks_internal.h b/src/zabbix_server/checks_internal.h index 0afc3a9e..469076bd 100644 --- a/src/zabbix_server/checks_internal.h +++ b/src/zabbix_server/checks_internal.h @@ -1,6 +1,6 @@ -/* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +/* +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_server/checks_simple.c b/src/zabbix_server/checks_simple.c index 2040c925..8c687a48 100644 --- a/src/zabbix_server/checks_simple.c +++ b/src/zabbix_server/checks_simple.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_server/checks_simple.h b/src/zabbix_server/checks_simple.h index 39102ca1..1099f4b0 100644 --- a/src/zabbix_server/checks_simple.h +++ b/src/zabbix_server/checks_simple.h @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_server/checks_snmp.c b/src/zabbix_server/checks_snmp.c index 2c6a0710..1d8c5bb3 100644 --- a/src/zabbix_server/checks_snmp.c +++ b/src/zabbix_server/checks_snmp.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_server/checks_snmp.h b/src/zabbix_server/checks_snmp.h index 34ba01b4..05269998 100644 --- a/src/zabbix_server/checks_snmp.h +++ b/src/zabbix_server/checks_snmp.h @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_server/housekeeper.c b/src/zabbix_server/housekeeper.c index 2550752a..20cf905a 100644 --- a/src/zabbix_server/housekeeper.c +++ b/src/zabbix_server/housekeeper.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_server/housekeeper.h b/src/zabbix_server/housekeeper.h index d0b5a88c..07c5d008 100644 --- a/src/zabbix_server/housekeeper.h +++ b/src/zabbix_server/housekeeper.h @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_server/pinger.c b/src/zabbix_server/pinger.c index 6506a115..810d144f 100644 --- a/src/zabbix_server/pinger.c +++ b/src/zabbix_server/pinger.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_server/pinger.h b/src/zabbix_server/pinger.h index 34407835..c0727fd2 100644 --- a/src/zabbix_server/pinger.h +++ b/src/zabbix_server/pinger.h @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_server/server.c b/src/zabbix_server/server.c index 717ed213..6ba49103 100644 --- a/src/zabbix_server/server.c +++ b/src/zabbix_server/server.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 diff --git a/src/zabbix_server/trapper.c b/src/zabbix_server/trapper.c index 06745511..ef1e07f6 100644 --- a/src/zabbix_server/trapper.c +++ b/src/zabbix_server/trapper.c @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 @@ -55,10 +55,11 @@ #include "trapper.h" -int process_trap(int sockfd,char *s) +int process_trap(int sockfd,char *s, int max_len) { char *p,*line,*host; char *server,*key,*value_string; + char copy[MAX_STRING_LEN]; char result[MAX_STRING_LEN]; int ret=SUCCEED; @@ -78,6 +79,8 @@ int process_trap(int sockfd,char *s) /* Process information sent by zabbix_sender */ else { + strscpy(copy,s); + server=(char *)strtok(s,":"); if(NULL == server) { @@ -90,11 +93,16 @@ int process_trap(int sockfd,char *s) return FAIL; } - value_string=(char *)strtok(NULL,":"); + value_string=strchr(copy,':'); + value_string=strchr(value_string+1,':'); + +/* value_string=(char *)strtok(NULL,":");*/ if(NULL == value_string) { return FAIL; } + /* It points to ':', so have to increment */ + value_string++; ret=process_data(sockfd,server,key,value_string); if( SUCCEED == ret) @@ -156,7 +164,7 @@ void process_trapper_child(int sockfd) zabbix_log( LOG_LEVEL_DEBUG, "Got line:%s", line); - process_trap(sockfd,line); + process_trap(sockfd,line, MAX_STRING_LEN); alarm(0); } diff --git a/src/zabbix_server/trapper.h b/src/zabbix_server/trapper.h index 5d6d0c93..ac987262 100644 --- a/src/zabbix_server/trapper.h +++ b/src/zabbix_server/trapper.h @@ -1,6 +1,6 @@ /* -** Zabbix -** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix ** ** 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 |