<? include(Str_Replace("binsnapshot.php","config.inc",__FILE__)); include(Str_Replace("binsnapshot.php","system.inc",__FILE__)); if (!$message) $message="*"; if (!$host) $host="*"; if (!$agent) $agent="*"; if (!$instance) $instance="*"; $binsnapshot_params = Array ( "$binsnapshot_executable", "-C $binsnapshot_config_file", "-S BinSnapshot.InputDatafile=$binstorage.dat", "-S BinSnapshot.InputIndexfile=$binstorage.idx", "-S BinSnapshot.OutputFile=stdout", "-S \"BinSnapshot.MsgName=$message\"", "-S \"BinSnapshot.Host=$host\"", "-S \"BinSnapshot.AgentName=$agent\"", "-S \"BinSnapshot.Instance=$instance\"", "-S \"BinSnapshot.Time=$time\""); $result = mysystem ($binsnapshot_params, false); if (count($result) < 2 || (ereg ("xml version", $result[0]) == false)) { for ($i=0;$i<count($result);$i++) { echo htmlentities ($result[$i]) . "<BR>"; } } header ("Content-type: text/xml"); for ($i=1;$i<count($result);$i++) { echo $result[$i]; } ?>