$q->close(); } } } } if ($nagios) { if (Host_group_scan::in_host_group_scan($conn, $hgname, 2007)) { Host_group_scan::delete($conn, $hgname, 2007); } Host_group_scan::insert($conn, $hgname, 2007); $q = new NagiosAdm(); $q->addNagiosHostGroup(new NagiosHostGroup($hgname, $hosts, $sensors), $conn); $q->close(); } else { if (Host_group_scan::in_host_group_scan($conn, $hgname, 2007)) { Host_group_scan::delete($conn, $hgname, 2007); } } Host_group::update($conn, $hgname, $threshold_c, $threshold_a, $rrd_profile, $sensors, $hosts, $descr); $db->close($conn); Util::clean_json_cache_files("(policy|vulnmeter|hostgroup)"); } if (isset($_SESSION['_hostgroup'])) { unset($_SESSION['_hostgroup']); } if ($_SESSION["menu_sopc"] == "Host groups" && POST('withoutmenu') != "1") { ?> <p><?php echo gettext("Host group succesfully updated"); ?> </p>
if ($type == 'groupAndHosts') { require_once 'classes/Host_scan.inc'; $host_list = Host_group::get_hosts($conn, $name); foreach ($host_list as $host) { $ip = $host->get_host_ip(); if (Host::can_delete($conn, $ip)) { if (Host_scan::in_host_scan($conn, $ip, 2007)) { Host_scan::delete($conn, $ip, 2007); } Host_scan::delete($conn, $ip, 3001); Host::delete($conn, $ip); } } } // Host_group_scan::delete($conn, $name, 3001); Host_group::delete($conn, $name); } else { echo "ERROR_CANNOT"; } $db->close($conn); ?> <p> <?php echo gettext("Host group deleted"); ?> </p> <p><a href="hostgroup.php"><?php echo gettext("Back"); ?> </a></p>