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 /frontends/php/include/hosts.inc.php | |
| 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
Diffstat (limited to 'frontends/php/include/hosts.inc.php')
| -rw-r--r-- | frontends/php/include/hosts.inc.php | 30 |
1 files changed, 28 insertions, 2 deletions
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; + } + } ?> |
