/** * @covers UptimeRobot::getMonitors */ public function testGetMonitors_created() { $this->assertNotEquals(null, $this->object->getMonitors($monitors = static::$newMonitorId, $customUptimeRatio = null, $logs = 1, $responseTimes = 1, $responseTimesAverage = 1, $alertContacts = 1, $showMonitorAlertContacts = 1, $showTimezone = 1)); }
* Before use replace 0000 by the value of id. * * @version 1.0 * @author Watchful * @authorUrl http://www.watchful.li * @license GNU General Public License version 2 or later */ require_once 'src/uptimerobot.php'; $upRobot = new UptimeRobot(); $upRobot::configure('YOUR-API-KEY', 1); $upRobot->setFormat('json'); //Define the format of responses (json or xml) /** * Get monitors */ $upRobot->getMonitors(); //Get all monitors $upRobot->getMonitors(00); //Get one monitor by her id $upRobot->getMonitors($monitors = 00, $customUptimeRatio = array('1', '7'), $logs = 0, $responseTimes = 1, $responseTimesAverage = 180, $alertContacts = 1, $showMonitorAlertContacts = 1, $showTimezone = 1); /** * New monitor */ $upRobot->newMonitor("Google", 'https://google.com', 1); //Monitor URL $upRobot->newMonitor("The W of Wikipedia", 'http://fr.wikipedia.org', 2, null, null, 2, 'W'); //Check word on a page $upRobot->newMonitor("Ping DNS of Google", '8.8.8.8', 3); //Ping IP $upRobot->newMonitor("Check custom port", 'exemple.com', 4, 99, 22); //Check custom port