PRTG NETWORK MONITOR测试._第1页
PRTG NETWORK MONITOR测试._第2页
PRTG NETWORK MONITOR测试._第3页
PRTG NETWORK MONITOR测试._第4页
PRTG NETWORK MONITOR测试._第5页
已阅读5页,还剩6页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、PRTG NETWORK MONITOR报警参数PTRG NETWORK MONITOR的报警参数(官方称为Placeholders,即占位符)很丰富,如下表所示:PlaceholderContainsSynonymVersion/Usage Comment%colorofstatecolor of the current object status (HTML hex code)might not work in older versions%companyPaesslers copyright string%commentsComments entered for the sensor%c

2、ommentssensorv15.4.21 or later: resolved placeholders contain the heading Sensor Comments%commentssensorComments entered for the sensor%commentsv15.4.21 or later: resolved placeholders contain the heading Sensor Comments%commentsdeviceComments entered for the parent devicev15.4.21 or later: resolved

3、 placeholders contain the heading Device Comments%commentsgroupComments entered for the parent groupv15.4.21 or later: resolved placeholders contain the heading Group Comments%commentsprobeComments entered for the parent probeavailable as of V12.4;v15.4.21 or later: resolved placeholders contain the

4、 heading Probe Comments%coveragecovered time spanmight not work in older versions%cumsincesince when data has been accumulated%dateevents date, in users timezone%datetimeevents date and time, in users timezone%devicename of the device in which the event was triggered%server%deviceidID number of the

5、device in which the event was triggeredV7.3.2 or later%downtime the item was down%downtimeaccumulated downtime%groupgroup in which the event was triggered%groupidID number of the group in which the event was triggeredV7.3.2 or later%historyhistory of sensor events%homePRTGs web server URL%homemPRTGs

6、 web server URL for Mobile Web GUIV9 or later%hostIP or DNS name of the device that triggered the eventCan be used as Agent IP in SNMP Trap notifications sent by PRTG (V13.x.7 or later)%iconofstatefilename incl. extension of the icon for the current object statusmight not work in older versions%last

7、checkwhen was the sensors last scan%lastdownwhen was the sensor down for the last time%lastmessagewhat message did the sensor send the last time%message%lastupwhen was the sensor up for the last time%lastvaluewhat value did the sensor send the last time%linkprobethe URL of the probe that triggered t

8、he eventmight not work in older versions%linkgroupthe URL of the group that triggered the eventmight not work in older versions%linkdevicethe URL of the device that triggered the eventmight not work in older versions%linksensorthe URL of the sensor that triggered the eventmight not work in older ver

9、sions%locationlocation of the device/server for which the event was triggered%messagewhich message did the sensor send the last time%lastmessage%namename of the sensor that triggered the event (including sensor type)%sensor%nodenamename of the node if in a clustermight not work in older versions%sho

10、rtnamename of the sensor that triggered the eventV7.1 or later%priosensor priority setting%priority%prioritysensor priority setting%prio%probeprobe under which the event was triggered%probeidID number of the probe under which the event was triggeredV7.3.2 or later%programnamePRTGs official name%prog

11、ramversionPRTG program version%sensorname of the sensor that triggered the event%name%sensoridID number of the sensor that triggered the eventV7.3.2 or later%servername of the device under which the event was triggered%device%serviceurlService URL configured for the device under which the event was

12、triggeredV9.1 or later%settingsmiscellaneous sensor settings, such as username for Windows, http, pop3 credentials, etc%sincesince when the current status is active%statesince%sitenamePRTGs web server (computer) name%statesincesince when the current status is active%since%statuscurrent sensor status

13、%summarycountreturns the number of events triggered during the defined time spanfor summarized notifications only!%syslogerrorsmax. last 20 syslog entries before the notification triggerV14.x.10 or later;works with Syslog Receiver sensors; can be used in the message part of Send Email notifications

14、only!%syslogmessagesmax. last 20 syslog entries before the notification triggerV14.x.12 or later;works with Syslog Receiver sensors; can be used in the message part of Send Email notifications only!%syslogwarningsmax. last 20 syslog entries before the notification triggerV14.x.10 or later;works with

15、 Syslog Receiver sensors; can be used in the message part of Send Email notifications only!%systemdatetimedate and time when the notification was sent, in users timezone%timeevents time, in users timezone%timezoneusers timezone name%toaddressaddress to which the notification was sent%traperrorsmax.

16、last 20 trap entries before the notification triggerV14.x.10 or later;works with SNMP Trap Receiver sensors; can be used in the message part of Send Email notifications only!%trapmessagesmax. last 20 trap entries before the notification triggerV14.x.12 or later;works with SNMP Trap Receiver sensors;

17、 can be used in the message part of Send Email notifications only!%trapwarningsmax. last 20 trap entries before the notification triggerV14.x.10 or later;works with SNMP Trap Receiver sensors; can be used in the message part of Send Email notifications only!%uptimeaccumulated uptime丰富的参数,可以让我们更灵活的定制

18、报警内容,但官方给出的参数如此之多,具体的报警的内容是怎样的,网上和官方也没有给出一个具体的模板可以参数,我们只能够自己测试每个参数所传递的内容。但如此之多的参数一个一个的测试显然工作量有点大。因此本文提出一种批量的测试方法。PRTG NETWORK MONITOR的参数测试测试思路PRTG的内置邮件报警好像不能用(本人测试未成功),因此找了一个折中的办法,即通过Python脚本发送邮件。但PRTG不能直接运行Python脚本,因此需要使用py2exe把写好的脚本转换成exe文件来执行。PRTG的占位符通过文件参数的形式传入Python脚本文件。通过Python脚本文件的编程,整合传入的文件参

19、数,实现内容的灵活制定。Python脚本-发邮件脚本要测试这个脚本,必须保证你的服务器能上网。import smtplibimport argparseimport sysfrom email.mime.text import MIMETextfrom email.header import Headerdef SendEmail(fromAdd, toAdd, subject, attachfile, htmlText): strFrom = fromAdd; strTo = toAdd; msg =MIMEText(htmlText); msgContent-Type = Text/HTM

20、L; msgSubject = Header(subject,gb2312); msgTo = strTo; msgFrom = strFrom; #链接邮箱服务器 smtp = smtplib.SMTP(); #登录您的邮箱 smtp.login(邮箱,客户端登陆密码); try: #执行发送 smtp.sendmail(strFrom,strTo,msg.as_string(); finally: smtp.close; #主函数,脚本从这里开始执行if _name_ = _main_: #,SendEmail是函数名称后面的括号中是函数的参数 fileargvlen=len(sys.ar

21、gv); #print(fileargvlen); smail=xxxx;#smail发件人 rmail=xxxx;#rmail收件人 title=监控平台通知邮件!#title邮件主题 attachment=null#attachment邮件附件路径 content=邮件内容:n #content邮件内容 for i in range(1,fileargvlen): #print(sys.argvi); if (sys.argvi=%): #content=content+sys.argvi+n content=content+n else: content=content+sys.argv

22、i+ SendEmail(smail,rmail,title,attachment,content);#发邮件Py2exe的安装在网上找py2exe的安装文件,根据你的Python版本。如果py2exe安装出错,提示找不到python,则做以下操作。1、win+r,输入regedit;2、检查以下注册表项是否存在,如果不存在请创建。HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/Python/PythonCore/3.4/InstallPathHKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/3.4/InstallPat

23、h我的python是安装在C:Python34目录下转换Python脚本为exe文件编写一个pytoexe.py文件,内容如下:# pytoexe.pyfrom distutils.core import setupimport py2exesetup(console=sendmail2.py)Sendmail2.py改成你转换成exe文件的Python文件名。CMD并把目录切换到你要转换的python文件目录,并运行以下命令python pytoexe.py py2exe转换成功后会出现以下目录。把dist目录中的所有内容都复制到“C:Program Files (x86)PRTG Netw

24、ork MonitorNotificationsEXE”目录下,注意:只复制exe文件是不能运行的,必须是dist目录下的所有文件。创建通知在控制台的:设置-通知-添加新通知,中添加一个执行程序的通知。脚本文件选择你构建的.exe文件。测试参数colorofstate: %colorofstate % company: %company % comments: %comments % commentssensor: %commentssensor % commentsdevice: %commentsdevice % commentsgroup: %commentsgroup % commen

25、tsprobe: %commentsprobe % coverage: %coverage % cumsince: %cumsince % date: %date % datetime: %datetime % device: %device % deviceid: %deviceid % down: %down % downtime: %downtime % group: %group % groupid: %groupid % history: %history % home: %home % homem: %homem % host: %host % iconofstate: %icon

26、ofstate % lastcheck: %lastcheck % lastdown: %lastdown % lastmessage: %lastmessage % lastup: %lastup % lastvalue: %lastvalue % linkprobe: %linkprobe % linkgroup: %linkgroup % linkdevice: %linkdevice % linksensor: %linksensor % location: %location % message: %message % name: %name % nodename: %nodenam

27、e % shortname: %shortname % prio: %prio % priority: %priority % probe: %probe % probeid: %probeid % programname: %programname % programversion: %programversion % sensor: %sensor % sensorid: %sensorid % server: %server % serviceurl: %serviceurl % settings: %settings % since: %since % sitename: %siten

28、ame % statesince: %statesince % status: %status % summarycount: %summarycount % syslogerrors: %syslogerrors % syslogmessages: %syslogmessages % syslogwarnings: %syslogwarnings % systemdatetime: %systemdatetime % time: %time % timezone: %timezone % toaddress: %toaddress % traperrors: %traperrors % tr

29、apmessages: %trapmessages % trapwarnings: %trapwarnings % uptime: %uptime至于参数为什么这么写,请参数Python脚本文件自己分析,这里不再详述。注意:这些参数要保证在一行,中间不能有回车。接收到的邮件样本,供不想做详细的人参考邮件内容中“英文“是占位符的名称,冒号后面是占位符代表的内容,不同环境,内容不一样。提示,传感器的备注是可以写内容的,占位符“%comments ”,可以传递这些内容,如果传感器备注中的内容写上邮件地址,是不是就可以实现根据不同的传感器触发报警后发邮件给相关责任人呢?邮件内容:colorofstat

30、e: #b4cc38 company: (c) 1996-2016 Paessler AG () comments: 传感器备注111.126222.126333.126444.126 commentssensor: 传感器备注111.126222.126333.126444.126 commentsdevice: 设备备注系统分析: Windows 其他名称: Www-Monitor WWW-MONITOR.WORKGROUP 系统信息: Manufacturer: VMware, Inc.Model: VMware Virtual PlatformSystem: x64-based PC

31、commentsgroup: commentsprobe: coverage: cumsince: 2016/5/19 23:39:30 date: 2016/5/21 datetime: 2016/5/21 23:22:45 device: Www-Monitor (8) Windows deviceid: 2074 down: (停机时间: 118 秒) downtime: 12.7774% 6 小时 5 分钟 group: 服务器 groupid: 2015 history: 历史记录2016/5/21 23:21:35 已编辑, 查看历史记录以获得详细信息。201

32、6/5/21 23:19:47 停机, Socket Error # 10061 Connection refused.2016/5/21 23:19:46 警告, Not Connected2016/5/21 23:18:37 已编辑, 查看历史记录以获得详细信息。2016/5/21 23:15:45 正常运行, 9 毫秒 home: http:/Www-Monitor/ homem: http:/Www-Monitor/m host: 8 iconofstate: led_green_big.png lastcheck: 2016/5/21 23:22:45 0 秒 以前 lastdown: 2016/5/21 23:21:

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论