定制 satrobit/prtg-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

satrobit/prtg-php

Composer 安装命令:

composer require satrobit/prtg-php

包简介

PHP API Wrapper for PRTG

README 文档

README

Using this library you can get details on your sensors , create charts and more

Install

Using Composer

Add this package to your composer.json:

"require": {
    "satrobit/prtg-php": "dev-master"
}

or by command line :

composer require satrobit/prtg-php

Usage

You need to construct a client first.

$client = new prtg(SERVER, USERNAME, PASSWORD);

like this:

$client = new prtg('https://prtg.paessler.com/', 'demo', 'demo');

Now you can use these methods to interact with the API:

Method: getsensordetails

This method returns details of a specified sensor

Parameters:

Name Type Description
sensorId int Sensor ID in PRTG

Example:

$sensorDetails = $client->getsensordetails(2017);

Method: historicdata

This method returns historic data on a specified sensor

Parameters:

Name Type Description
sensorId int Sensor ID in PRTG
sdate string Starting date
edate string Ending date
avg int Average

Example:

$historicData = $client->historicdata('2017', '2017-07-26', '2017-07-27', 15);

Method: chart

This method returns a chart of a specified sensor

Parameters:

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:

$chart = $client->chart(2017, '2017-07-26', '2017-07-27', 2, 'svg', 15, 270, 850);

Examples

Check out examples.php .

License

This project is released under the MIT License.

统计信息

  • 总下载量: 110
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-08-03