版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、PRTG NETWORK MONITOR報(bào)警參數(shù)PTRG NETWORK MONITOR的報(bào)警參數(shù)(官方稱為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豐富的參數(shù),可以讓我們更靈活的定制
18、報(bào)警內(nèi)容,但官方給出的參數(shù)如此之多,具體的報(bào)警的內(nèi)容是怎樣的,網(wǎng)上和官方也沒(méi)有給出一個(gè)具體的模板可以參數(shù),我們只能夠自己測(cè)試每個(gè)參數(shù)所傳遞的內(nèi)容。但如此之多的參數(shù)一個(gè)一個(gè)的測(cè)試顯然工作量有點(diǎn)大。因此本文提出一種批量的測(cè)試方法。PRTG NETWORK MONITOR的參數(shù)測(cè)試測(cè)試思路PRTG的內(nèi)置郵件報(bào)警好像不能用(本人測(cè)試未成功),因此找了一個(gè)折中的辦法,即通過(guò)Python腳本發(fā)送郵件。但PRTG不能直接運(yùn)行Python腳本,因此需要使用py2exe把寫(xiě)好的腳本轉(zhuǎn)換成exe文件來(lái)執(zhí)行。PRTG的占位符通過(guò)文件參數(shù)的形式傳入Python腳本文件。通過(guò)Python腳本文件的編程,整合傳入的文件參
19、數(shù),實(shí)現(xiàn)內(nèi)容的靈活制定。Python腳本-發(fā)郵件腳本要測(cè)試這個(gè)腳本,必須保證你的服務(wù)器能上網(wǎng)。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; #鏈接郵箱服務(wù)器 smtp = smtplib.SMTP(); #登錄您的郵箱 smtp.login(郵箱,客戶端登陸密碼); try: #執(zhí)行發(fā)送 smtp.sendmail(strFrom,strTo,msg.as_string(); finally: smtp.close; #主函數(shù),腳本從這里開(kāi)始執(zhí)行if _name_ = _main_: #,SendEmail是函數(shù)名稱后面的括號(hào)中是函數(shù)的參數(shù) fileargvlen=len(sys.ar
21、gv); #print(fileargvlen); smail=xxxx;#smail發(fā)件人 rmail=xxxx;#rmail收件人 title=監(jiān)控平臺(tái)通知郵件!#title郵件主題 attachment=null#attachment郵件附件路徑 content=郵件內(nèi)容:n #content郵件內(nèi)容 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);#發(fā)郵件Py2exe的安裝在網(wǎng)上找py2exe的安裝文件,根據(jù)你的Python版本。如果py2exe安裝出錯(cuò),提示找不到python,則做以下操作。1、win+r,輸入regedit;2、檢查以下注冊(cè)表項(xiàng)是否存在,如果不存在請(qǐng)創(chuàng)建。HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/Python/PythonCore/3.4/InstallPathHKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/3.4/InstallPat
23、h我的python是安裝在C:Python34目錄下轉(zhuǎn)換Python腳本為exe文件編寫(xiě)一個(gè)pytoexe.py文件,內(nèi)容如下:# pytoexe.pyfrom distutils.core import setupimport py2exesetup(console=sendmail2.py)Sendmail2.py改成你轉(zhuǎn)換成exe文件的Python文件名。CMD并把目錄切換到你要轉(zhuǎn)換的python文件目錄,并運(yùn)行以下命令python pytoexe.py py2exe轉(zhuǎn)換成功后會(huì)出現(xiàn)以下目錄。把dist目錄中的所有內(nèi)容都復(fù)制到“C:Program Files (x86)PRTG Netw
24、ork MonitorNotificationsEXE”目錄下,注意:只復(fù)制exe文件是不能運(yùn)行的,必須是dist目錄下的所有文件。創(chuàng)建通知在控制臺(tái)的:設(shè)置-通知-添加新通知,中添加一個(gè)執(zhí)行程序的通知。腳本文件選擇你構(gòu)建的.exe文件。測(cè)試參數(shù)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至于參數(shù)為什么這么寫(xiě),請(qǐng)參數(shù)Python腳本文件自己分析,這里不再詳述。注意:這些參數(shù)要保證在一行,中間不能有回車。接收到的郵件樣本,供不想做詳細(xì)的人參考郵件內(nèi)容中“英文“是占位符的名稱,冒號(hào)后面是占位符代表的內(nèi)容,不同環(huán)境,內(nèi)容不一樣。提示,傳感器的備注是可以寫(xiě)內(nèi)容的,占位符“%comments ”,可以傳遞這些內(nèi)容,如果傳感器備注中的內(nèi)容寫(xiě)上郵件地址,是不是就可以實(shí)現(xiàn)根據(jù)不同的傳感器觸發(fā)報(bào)警后發(fā)郵件給相關(guān)責(zé)任人呢?郵件內(nèi)容:colorofstat
30、e: #b4cc38 company: (c) 1996-2016 Paessler AG () comments: 傳感器備注111.126222.126333.126444.126 commentssensor: 傳感器備注111.126222.126333.126444.126 commentsdevice: 設(shè)備備注系統(tǒng)分析: Windows 其他名稱: Www-Monitor WWW-MONITOR.WORKGROUP 系統(tǒng)信息: 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: (停機(jī)時(shí)間: 118 秒) downtime: 12.7774% 6 小時(shí) 5 分鐘 group: 服務(wù)器 groupid: 2015 history: 歷史記錄2016/5/21 23:21:35 已編輯, 查看歷史記錄以獲得詳細(xì)信息。201
32、6/5/21 23:19:47 停機(jī), Socket Error # 10061 Connection refused.2016/5/21 23:19:46 警告, Not Connected2016/5/21 23:18:37 已編輯, 查看歷史記錄以獲得詳細(xì)信息。2016/5/21 23:15:45 正常運(yùn)行, 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. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 機(jī)場(chǎng)港口航運(yùn)綜合服務(wù)總承包協(xié)議
- 社交電商平臺(tái)技術(shù)研發(fā)合作協(xié)議
- 新零售模式合作協(xié)議
- 物流運(yùn)輸貨物損壞風(fēng)險(xiǎn)轉(zhuǎn)移免責(zé)協(xié)議
- 2025年度能源項(xiàng)目融資擔(dān)保服務(wù)合同
- 2025年度房地產(chǎn)項(xiàng)目暖場(chǎng)活動(dòng)推廣合同
- 2025年度跑步賽事志愿者招募與培訓(xùn)協(xié)議
- 2025年度女方離婚協(xié)議書(shū)撰寫(xiě)手冊(cè)
- 2025年度智能樂(lè)器租賃服務(wù)合同模板2篇
- 2025年度智能門(mén)禁系統(tǒng)購(gòu)銷合同(含技術(shù)支持)
- DB4511T 0002-2023 瓶裝液化石油氣充裝、配送安全管理規(guī)范
- 企業(yè)內(nèi)部客供物料管理辦法
- 婦科臨床葡萄胎課件
- 三基三嚴(yán)練習(xí)題庫(kù)與答案
- 傳媒行業(yè)突發(fā)事件應(yīng)急預(yù)案
- 債務(wù)抵租金協(xié)議書(shū)范文范本
- 藥學(xué)技能競(jìng)賽標(biāo)準(zhǔn)答案與評(píng)分細(xì)則處方
- 山東省濰坊市2023-2024學(xué)年高二下學(xué)期期末考試 歷史 含解析
- 中醫(yī)診療規(guī)范
- 第14課《葉圣陶先生二三事》導(dǎo)學(xué)案 統(tǒng)編版語(yǔ)文七年級(jí)下冊(cè)
- 施工項(xiàng)目平移合同范本
評(píng)論
0/150
提交評(píng)論