function do_stuff() { global $input; global $info; global $service_details; global $host_details; global $objects; global $obj_count; global $statecount; global $unique; global $config; //$input = (isset($argv[1]) ? $argv[1] : die("Error: Missing group ID as an argument\n")); include dirname(__FILE__) . '/functions/read_conf.php'; include dirname(__FILE__) . '/constants.inc.php'; include dirname(__FILE__) . '/functions/read_service_status.php'; include dirname(__FILE__) . '/functions/bpi_functions.php'; include dirname(__FILE__) . '/BpGroup_class.php'; include dirname(__FILE__) . '/functions/bpi2xml.php'; $info = get_info(); list($host_details, $service_details) = grab_details(); //global array of service status //initialize all BpGroup instances and determine properties of all groups bpi_init(); if (isset($objects[$input])) { $obj = $objects[$input]; $output = $obj->return_state_details(); //echo $output['msg']; // Exit correctly $num = $output['code']; fwrite(STDOUT, trim($output['msg']) . "\n"); //echo $output['code']."\n"; exit($num); } else { echo "Unknown BPI Group Index\n"; exit(3); } }
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, STRICT LIABILITY, TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) OR OTHER ACTION, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. //ini_set('display_errors','on'); include 'header.php'; //html header stuff include 'inc.inc.php'; //master include file for all functions and classes $info = get_info(); //read info from main configuration file (bpi.conf) list($host_details, $service_details) = grab_details(); //global array of service status from status.dat file $objects = array(); //main array of bpi group objects $obj_count = 0; $statecount = 0; $unique = 0; $config = true; $errors = ''; $bpiroot = dirname(__FILE__); //initialize all BpGroup instances and determine properties of all groups //see bpi_functions.php for function details bpi_init(); //check for correct permissions error_check(); //handle any page requests and redirection //see bpi_functions.php for function details bpi_page_router(); //end php //close html page include dirname(__FILE__) . '/footer.php';