Exemplo n.º 1
0
?>
"/>
    </head>
    
    <body>
    <?php 
if ($data['status'] != 'error') {
    try {
        $db = new ossim_db();
        $conn = $db->connect();
        $asset_group = new Asset_group($id);
        $asset_group->load_from_db($conn);
        $asset_group->set_name($name);
        $asset_group->set_owner($owner);
        $asset_group->set_descr($descr);
        $asset_group->set_threshold($threshold_a, 'a');
        $asset_group->set_threshold($threshold_c, 'c');
        $asset_group->save_in_db($conn);
        $_hosts_data_aux = $asset_group->get_hosts($conn, '', TRUE);
        $hosts = array_keys($_hosts_data_aux[0]);
        if (!empty($nagios)) {
            if (Asset_group_scan::is_plugin_in_group($conn, $id, 2007)) {
                Asset_group_scan::delete_plugin_from_db($conn, $id, 2007);
            }
            Asset_group_scan::save_plugin_in_db($conn, $id, 2007);
            foreach ($hosts as $host_id) {
                if (!Asset_host_scan::is_plugin_in_host($conn, $host_id, 2007)) {
                    Asset_host_scan::save_plugin_in_db($conn, $host_id, 2007);
                }
            }
        } else {