summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/hosts.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'frontends/php/include/hosts.inc.php')
-rw-r--r--frontends/php/include/hosts.inc.php29
1 files changed, 28 insertions, 1 deletions
diff --git a/frontends/php/include/hosts.inc.php b/frontends/php/include/hosts.inc.php
index 7a843557..81ac6b60 100644
--- a/frontends/php/include/hosts.inc.php
+++ b/frontends/php/include/hosts.inc.php
@@ -20,7 +20,6 @@
?>
<?php
require_once "include/graphs.inc.php";
-require_once "include/profiles.inc.php";
require_once "include/triggers.inc.php";
require_once "include/items.inc.php";
@@ -1288,4 +1287,32 @@ require_once "include/items.inc.php";
}
return $status;
}
+
+// Add Host Profile
+
+ function add_host_profile($hostid,$devicetype,$name,$os,$serialno,$tag,$macaddress,$hardware,$software,$contact,$location,$notes){
+
+ $result=DBselect("select * from hosts_profiles where hostid=$hostid");
+ if(DBfetch($result)){
+ error("Host profile already exists");
+ return 0;
+ }
+
+ $result=DBexecute("insert into hosts_profiles".
+ " (hostid,devicetype,name,os,serialno,tag,macaddress,hardware,software,contact,".
+ "location,notes) values ($hostid,".zbx_dbstr($devicetype).",".zbx_dbstr($name).",".
+ zbx_dbstr($os).",".zbx_dbstr($serialno).",".zbx_dbstr($tag).",".zbx_dbstr($macaddress).
+ ",".zbx_dbstr($hardware).",".zbx_dbstr($software).",".zbx_dbstr($contact).",".
+ zbx_dbstr($location).",".zbx_dbstr($notes).")");
+
+ return $result;
+ }
+
+// Delete Host Profile
+
+ function delete_host_profile($hostid){
+ $result=DBexecute("delete from hosts_profiles where hostid=$hostid");
+
+ return $result;
+ }
?>