prtg

http://www.paessler.com/prtg/features

prtg的sensor技术

数据库监视

Flexible Alerting

  • 9 notification technologies: Send Email, SMS/Pager, syslog and SNMP Trap, HTTP request, Event log entry, Play alarm sound files, Amazon SNS, any external technology that can be triggered by an EXE or batch file
  • Status alerts (up, down, warning)
  • Limit alerts (value above/below x)
  • Threshold alerts (above/below x for y minutes)
  • Multiple condition alerts (x and y are down)
  • Escalation alerts (extra notifications every x min during downtime)
  • Dependencies (avoid alarm floods)
  • Acknowledge Alarms (no more notifications for this alarm)
  • Alert Scheduling (no low priority alerts at night)

通知投递  告诉prtg如何发送消息

通知    定义消息的类别与内容

通知触发  

prtg api编程

<prtg>
<text>
</text>
<error>
</error>
<result>
</result>
</prtg>

<prtg>
<result>
<channel>a</channel>
<value>10</value>
</result>
<result>
<channel>b</channel>
<value>20</value>
</result>
</prtg>

[root@109-com1 scripts]# cat rx
#!/bin/bash
eth=eth0
RXpre=$(ifconfig ${eth} | grep bytes | awk  '{print $2}'| awk -F":" '{print $2}')
TXpre=$(ifconfig ${eth} | grep bytes | awk '{print $6}' | awk -F":" '{print $2}')
sleep 1
RXnext=$(ifconfig ${eth} | grep bytes | awk  '{print $2}'| awk -F":" '{print $2}')
TXnext=$(ifconfig ${eth} | grep bytes | awk '{print $6}' | awk -F":" '{print $2}')

echo "0:$(((${RXnext}-${RXpre})/1024)):recv!!!KB/s"

[root@109-com1 scripts]# cat daxiao
#!/bin/bash
daxiao=`ls -l  /var/log/asterisk/messages |cut -d " " -f5`
echo "0:$daxiao:messages!!!!!!!"

prtg change web default sound  
1.mp3与ogg同时替换命名为beep
2.并且要将mp3转换为ogg格式
3.清空浏览器缓存

prtg邮件发送三步走
1.通知投递,设置smtp地址与用户名与密码
2.通知
3.触发

prtg api
ASAP as soon as possible
172.16.1.14:8080

prtg
live graph 2小时120个值,1分钟扫描间隔
2天

SSH Script sensors

only one channel per sensor

The returned data for standard SSH Script sensors must be in the following format:
returncode:value:message

Value has to be a 64 bit integer or float and will be used as the resulting value for this sensor (e.g. bytes, milliseconds, etc.),
message can be any string and will be stored in the database.

[%sitename] %device %name %status %down (%message)

C:\ProgramData\Paessler\PRTG Network Monitor\

#!/bin/bash

port="80"
service="WEB"

NETSTAT=`which netstat`
ID=`which id`

die(){
    exit 999
}

is_root(){
    local id=$($ID -u)
    if [ $id -ne 0 ]
    then
        echo "4:500:You have to be root to run $0."    # returncode 4 = put sensor in DOWN status
        die
    fi
}

preparation(){
    if [ ! -x $NETSTAT ]
    then
        echo "2:500:netstat not found."
        die
    fi
    if [ ! -x $ID ]
    then
        echo "2:500:id not found."    # returncode = 2 = put sensor in DOWN status
        die
    fi
    is_root
}

check_service(){
    serviceIsRunning=false
    openPorts=$($NETSTAT -tulpn | grep -vE '^Active|Proto' | grep 'LISTEN' | awk '{ print $4}' | awk -F: '{print $NF}' | sed '/^$/d' | sort -u)
    for openPort in $openPorts
    do
        if [ "$port" == "$openPort" ]
        then
            serviceIsRunning=true
            echo "0:200:$service is running."    # returncode 0 = put sensor in OK status
            break
        fi
    done
    if [ $serviceIsRunning == false ]
    then
        echo "1:404:$service is not running."    # returncode 1 = put sensor in WARNING status
    fi
}

main(){
    preparation
    check_service
}

main

These few lines cover a lot of simple service check needs.
Here's a super simple service check script I'm using on Ubuntu systems. When you set it up in PRTG, just put the service name you want to check in the parameter box.
That becomes $1 in the script. $? is the status of the service as reported by the service command.
This is all assembled in the echo to be formatted to make PRTG show pretty and informative results.

#!/bin/sh

service $1 status 2>&1 1>/dev/null

if [ $? -ne 0 ]; then
  echo "1:$?:$1 down"
else
  echo "0:$?:OK"
fi

prtg的更多相关文章

  1. PRTG测试!

    http://www.paessler.com/prtg. 我的效果图:

  2. PRTG参考价格

    2010年的香港的网站上看到如下价格:http://kb.option-hk.com/?tag=prtg-network-monitor 什么才算一个sensor What counts as a s ...

  3. 使用PRTG和panabit结合定位网络阻塞的来源

    一.背景   在网络管理工作中,有时会出现网络阻塞,需要定位阻塞来源以采取措施解决问题.二.以一个网络阻塞案例说明定位方法   案例:某企业日常使用多条网络线路,某一段时间发现某条线路传输速率下降,对 ...

  4. PRTG安装

    1.去官网下载,记录下试用秘钥,然后执行安装 2. 3. 4.输入秘钥 5. 6.安装完成后自动转到如下页面,点击启动Guru 7. 8. 9. 10.输入prtgadmin,密码prtgadmin ...

  5. opsview

    nagios,cacti,opsview,prtg,zabbix http://www.opsview.com 1.需要注册一个账号,createyuan#sohu.com

  6. linux服务之crond

    use the following command add entries to crontab should take effect right away. right away(立即,立刻) #c ...

  7. linux知识点

    通过gui来使用通过api来使用通过cli来使用通过tui来使用 进程不在,但tcp连接还一直存在的解决办法--tcpkill命令 http://www.centoscn.com/CentOS/Int ...

  8. 虚拟化之vmware-vsphere (web) client

    两种客户端 vsphere client 配置>软件>高级设置里的变量 uservars.supressshellwarning=1 vsphere web client 安装完vSphe ...

  9. shell之脚本片断

    16. 以下是平台信息 CentOS Linux release 7.1.1503 (Core) Linux mysql-dev1 3.10.0-229.el7.x86_64 #1 SMP Fri M ...

随机推荐

  1. 10年省赛-Greatest Number (二分+暴力) + 12年省赛-Pick apples(DP) + UVA 12325(暴力-2次枚举)

    题意:给你n个数,在里面取4个数,可以重复取数,使和不超过M,求能得到的最大的数是多少: 思路:比赛时,和之前的一个题目很像,一直以为是体积为4(最多选择四次)的完全背包,结果并不是,两两求和,然后二 ...

  2. Java 集合深入理解(3):Collection

    点击查看 Java 集合框架深入理解 系列, - ( ゜- ゜)つロ 乾杯~ 今天心情有点粉,来学学 Collection 吧! 什么是集合? 集合,或者叫容器,是一个包含多个元素的对象: 集合可以对 ...

  3. javascript js写特效日历

    <!doctype html public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  4. ASP.NET中的指令:

    来源:http://www.cnblogs.com/zhuisha/archive/2008/07/02/1234222.html ASP.NET中的指令: @Page指令: @Page指令只能在.a ...

  5. LeetCode Combinations (DFS)

    题意: 产生从1-n的k个数的所有组合,按升序排列并返回. 思路: DFS一遍即可解决.注意升序. class Solution { public: vector<vector<int&g ...

  6. 本地安装git

    在ubuntu上安装git特别简单 首先用命令查看是否安装git 在终端输入 git 如果没有安装 sudo apt-get install git 安装完之后,测试是否安装成功: git --ver ...

  7. dalvik虚拟内存管理之二——垃圾收集

    转载自http://www.miui.com/thread-75028-1-1.html 垃圾收集是dalvik虚拟机内存管理的核心,垃圾收集的性能在很大程度上影响了一个Java程序内存使用的效率.顾 ...

  8. Python天天美味(13) - struct.unpack

    转载自:http://www.cnblogs.com/coderzh/archive/2008/05/04/1181462.html Python中按一定的格式取出某字符串中的子字符串,使用struc ...

  9. 放课后的约定 by:S_H_Y

    题目背景 十年.十年前.天空的蔚蓝,云彩的舒软.我,怎么会认识你.洁白的,洁白的,十年前.我无法忘却.终究是小时候的约定.记忆被困在冻土里,有时我不认识那天的我.难道一切,都锁在心里面了吗? 题目描述 ...

  10. 越狱Season 1-Episode 11: And Then There Were 7-M

    Season 1, Episode 11: And Then There Were 7-M -Michael: That one 那个 -businessman: Nice choice choice ...