dev-master
9999999-dev https://github.com/satrobit/prtg-phpPHP API Wrapper for PRTG
MIT
The Requires
- php >=5.6.0
monitoring network prtg prtg-php
PHP API Wrapper for PRTG
Using this library you can get details on your sensors , create charts and more, (*1)
Add this package to your composer.json
:, (*2)
"require": { "satrobit/prtg-php": "dev-master" }
or by command line :, (*3)
composer require satrobit/prtg-php
You need to construct a client first., (*4)
$client = new prtg(SERVER, USERNAME, PASSWORD);
like this:, (*5)
$client = new prtg('https://prtg.paessler.com/', 'demo', 'demo');
Now you can use these methods to interact with the API:, (*6)
This method returns details of a specified sensor, (*7)
Parameters: , (*8)
Name | Type | Description |
---|---|---|
sensorId | int | Sensor ID in PRTG |
Example:, (*9)
$sensorDetails = $client->getsensordetails(2017);
This method returns historic data on a specified sensor, (*10)
Parameters: , (*11)
Name | Type | Description |
---|---|---|
sensorId | int | Sensor ID in PRTG |
sdate | string | Starting date |
edate | string | Ending date |
avg | int | Average |
Example:, (*12)
$historicData = $client->historicdata('2017', '2017-07-26', '2017-07-27', 15);
This method returns a chart of a specified sensor, (*13)
Parameters: , (*14)
Name | Type | Description |
---|---|---|
sensorId | int | Sensor ID in PRTG |
sdate | string | Starting date |
edate | string | Ending date |
graphid | int | Graph ID |
type | string | Returned object type like svg, png |
avg | int | Average |
height | int | Height of the chart (px) |
width | int | Width of the chart (px) |
Example:, (*15)
$chart = $client->chart(2017, '2017-07-26', '2017-07-27', 2, 'svg', 15, 270, 850);
Check out examples.php ., (*16)
This project is released under the MIT License., (*17)
PHP API Wrapper for PRTG
MIT
monitoring network prtg prtg-php