This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
////////// | |
// THIS FILE DUMPS THE DATA TO DATA FILE | |
// (c) Travis Mathis - travisdmathis@gmail.com | |
// Zabbix Report Generator v0.1 | |
// | |
// INCLUDES | |
require_once("ZabbixAPI.class.php"); | |
// ERROR REPORTING |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
foreach ($data as $line){ | |
// go through each line, showing it as required, if it is surrounded by '<>' then | |
// assume that it is a title | |
$line=chop($line); | |
if (strlen($line) && $line[0]=='#'){ | |
// comment, or new page request | |
switch($line){ | |
case '#NP': | |
$pdf->ezNewPage(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
////////// | |
// THIS FILE DUMPS THE DATA TO DATA FILE | |
// (c) Travis Mathis - travisdmathis@gmail.com | |
// Zabbix Report Generator v0.1 | |
// | |
// INCLUDES | |
require_once("ZabbixAPI.class.php"); | |
// ERROR REPORTING |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ZabbixAPI::debugEnabled(TRUE); | |
ZabbixAPI::login($z_server,$z_user,$z_pass) | |
or die('Unable to login: '.print_r(ZabbixAPI::getLastError(),true)); | |
//fetch graph data for single host | |
$hosts = ZabbixAPI::fetch_array('host','get',array('extendoutput'=>'shorten','select_graphs'=>'shorten','filter'=>array('host'=>$site))) | |
or die('Unable to get hostids: '.print_r(ZabbixAPI::getLastError(),true)); | |
//echo "Hosts: ".print_r($hosts, true)."\n<br>"; | |
foreach($hosts as $host) { | |
foreach($host as $ho) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#========================================================= | |
# Avaya PRI UP/Down Check | |
# Travis Mathis - travis.mathis@gdit.com | |
# Version 1.1 | |
# Change Log: Moved Total Channels from seperate script 1/9/2012 | |
#========================================================= | |
# VARIABLES | |
act='0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get graphids | |
// Login to Zabbix API using ZabbixAPI.class.php | |
ZabbixAPI::debugEnabled(TRUE); | |
ZabbixAPI::login($z_server,$z_user,$z_pass) | |
or die('Unable to login: '.print_r(ZabbixAPI::getLastError(),true)); | |
//fetch graph data for single host | |
$hosts = ZabbixAPI::fetch_array('host','get',array('extendoutput'=>'shorten','select_graphs'=>'shorten','filter'=>array('host'=>$site))) | |
or die('Unable to get hostids: '.print_r(ZabbixAPI::getLastError(),true)); | |
echo "Hosts: ".print_r($hosts, true)."\n<br>"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ZabbixAPI::debugEnabled(TRUE); | |
ZabbixAPI::login($z_server,$z_user,$z_pass) | |
or die('Unable to login: '.print_r(ZabbixAPI::getLastError(),true)); | |
$hosts = ZabbixAPI::fetch_array('host','get',array('extendoutput'=>1,'filter'=>array('host'=>$site,'select_graphs'))) | |
or die('Unable to get hostids: '.print_r(ZabbixAPI::getLastError(),true)); | |
echo "Hosts: ".print_r($hosts, true)."\n<br>"; | |
# OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ZabbixAPI::debugEnabled(TRUE); | |
ZabbixAPI::login($z_server,$z_user,$z_pass) | |
or die('Unable to login: '.print_r(ZabbixAPI::getLastError(),true)); | |
$hosts = ZabbixAPI::fetch_array('host','get',array('host'=>$site)) | |
or die('Unable to get hostids: '.print_r(ZabbixAPI::getLastError(),true)); | |
echo "Hosts: ".print_r($hosts, true)."\n<br>"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ZabbixAPI::debugEnabled(TRUE); | |
ZabbixAPI::login($z_server,$z_user,$z_pass) | |
or die('Unable to login: '.print_r(ZabbixAPI::getLastError(),true)); | |
$hosts = ZabbixAPI::fetch_array('host','get',array('extendoutput'=>1, 'host'=>$site, 'select_graphs')) | |
or die('Unable to get hostids: '.print_r(ZabbixAPI::getLastError(),true)); | |
echo "Hosts: ".print_r($hosts, true)."\n<br>"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select host,hostid,itemid,graphid,description from items left join graphs on graphs.graphid left join hosts on hosts.host limit 5; |
NewerOlder