예제 #1
0
        }
        $threshold_a = $host->get_threshold_a();
        $threshold_c = $host->get_threshold_c();
        $os = $host->get_os($conn);
        $mac = $host->get_mac_address($conn);
        $mac_vendor = $host->get_mac_vendor($conn);
        $coordinates = $host->get_coordinates();
        $latitude = $coordinates['lat'];
        $longitude = $coordinates['lon'];
        $zoom = $coordinates['zoom'];
        $icon = $host->get_imgtag();
        if (empty($latitude) || empty($longitude)) {
            $gi = geoip_open("/usr/share/geoip/GeoLiteCity.dat", GEOIP_STANDARD);
            $record = geoip_record_by_addr($gi, $ip);
            if (is_null($record)) {
                $record = geoip_record_by_addr($gi, Session_activity::getRealIpAddr());
            }
            if (!is_null($record)) {
                $city = $record->city;
                $country = $record->country_name;
                $latitude = $record->latitude;
                $longitude = $record->longitude;
            }
            geoip_close($gi);
        }
        $num_sensors = count($sensors);
    }
}
/* services update */
if (GET('update') == 'services') {
    $conf = $GLOBALS["CONF"];