All Projects → hongfeioo → NodePingManage

hongfeioo / NodePingManage

Licence: Apache-2.0 license
可用于监控交换机/服务器/防火墙的存活状态的ping监控报警系统

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to NodePingManage

Monitorr
"Monitorr” is a self-hosted PHP web app that monitors the status of local and remote network services, websites, and applications.
Stars: ✭ 449 (+855.32%)
Mutual labels:  monitor, ping
site-monitor
监控网站的可访问性的监控系统
Stars: ✭ 48 (+2.13%)
Mutual labels:  monitor, ping
heartbeats
一个基于数据上报的监控系统. 用于监控定时和定期类型服务监控状况
Stars: ✭ 25 (-46.81%)
Mutual labels:  monitor, ping
Lagmonitor
Monitor performance of your Minecraft server. Similar to VisualVM and Java Mission Control.
Stars: ✭ 147 (+212.77%)
Mutual labels:  monitor, ping
Rich-Presence-U
Display your Nintendo games on Discord.
Stars: ✭ 77 (+63.83%)
Mutual labels:  switch
webping
🚦 Python script to monitor web pages.
Stars: ✭ 20 (-57.45%)
Mutual labels:  ping
lemon
Lemon – LED Monitor – is a $79.43 opensource alternative to LaMetric that supports GitHub-, IFTTT- and Zapier-webhooks and even integrates with Pushover!
Stars: ✭ 45 (-4.26%)
Mutual labels:  monitor
unifi-controllable-switch
TOUGHswitch firmware to integrate with the UniFi Controller (experimental).
Stars: ✭ 24 (-48.94%)
Mutual labels:  switch
ModuleMania
Various useful sysmodules (kip files) for Nintendo Switch, to be used with CFW
Stars: ✭ 30 (-36.17%)
Mutual labels:  switch
redis-traffic-stats
Live monitor & analyze Redis queries on your client
Stars: ✭ 84 (+78.72%)
Mutual labels:  monitor
yrs
Yarn registry switch tool
Stars: ✭ 12 (-74.47%)
Mutual labels:  switch
botw-unexplored
Easily view the unexplored korok seeds and locations in your BotW savefile on your Switch
Stars: ✭ 79 (+68.09%)
Mutual labels:  switch
smashtierlist
🎮⚡️ Popular tier lists for Super Smash Bros. series
Stars: ✭ 40 (-14.89%)
Mutual labels:  switch
ngx-ui-switch
Angular UI Switch component
Stars: ✭ 109 (+131.91%)
Mutual labels:  switch
gatus
⛑ Automated service health dashboard
Stars: ✭ 3,018 (+6321.28%)
Mutual labels:  monitor
theonionbox
Dashboard to monitor Tor node operations
Stars: ✭ 116 (+146.81%)
Mutual labels:  monitor
redis-healthy
It retrieves metrics, periodically, from Redis (or sentinel) and send them to Logstash
Stars: ✭ 62 (+31.91%)
Mutual labels:  monitor
kping
Large Scale, High Performance flood ping.
Stars: ✭ 16 (-65.96%)
Mutual labels:  ping
Switch
Manage chrome extensions from the toolbar
Stars: ✭ 13 (-72.34%)
Mutual labels:  switch
ping-exporter
Prometheus Ping exporter
Stars: ✭ 60 (+27.66%)
Mutual labels:  ping

Node Ping Manage

描述

本项目通过ping的方式监测设备的死活,出现状态变化即触发报警, 报警方式可以是邮件/短信。

本项目已经Docker化,推荐使用

启动方法

cd /home
git clone https://github.com/hongfeioo/NodePingManage.git
cd NodePingManage
git clone  https://github.com/hongfeioo/messagemodule.git
python npm.py

配置文件格式

vi npm.ini 
设备IP 设备描述 初始状态关键字 邮箱 手机号
114.114.114.114 CoreSwExample Init [email protected] 1352116188X
192.168.1.1 Server1 Init [email protected] 1352116188X

邮件短信报警模块配置

messagemodule

Up,Down 报警状态机

  1. 在5次ping测试中,有一次通则为:Up
  2. 在5次ping测试中,全部超时则为:Down , 每次ping超时时间为2秒
  3. 检测次数和超时时间在ping.py中verbose_ping函数参数中修改

小技巧

  1. 主程序中 sms_off 默认为0 ,如果为1则全局关闭短信
  2. 主程序中 mail_off 默认为 0 ,如果为1则全局关闭邮件发送
  3. 主程序中 MAX_process 默认为300, 用于限制ping的并发数
  4. 手机号或者邮箱中如果出现null字符串则跳过这个联系人
  5. 当接受报警的是多邮箱或者多手机号时用分号隔开即可
  6. 当你要部署多套npm的时候,npm_title 变量用来区分报警是从哪个节点产生的

程序原理介绍

  1. 主程序第一次运行时,从配置文件npm.ini中读取每行信息,并发对每一行的主机ip进行ping测试, 探测的结果会写入npm.tmp文件
  2. 当程序第二次运行时,会先读取npm.tmp文件中数据作为参考,然后进行第二次ping探测,如果发现本次探测结果和参考状态不符,则说明状态有变化,触发报警,并把最新状态存入npm.tmp
  3. 循环上边的步骤,实现监控。如果对配置文件npm.ini进行了调整,需要删除npm.tmp文件,让程序初始化。

添加计划任务

*/1 * * * * python /root/NodePingManage/npm.py  > /dev/null

注意:如果使用计划任务,npm.py中的devicefile_init 和 devicetmp 路径请使用绝对路径

排错

  1. 配置文件末尾请不要留空行
  2. 所有日志默认输出的位置是:/root/mylog.txt
  3. 如果修改了pingModule中的文件,需要删除*.pyc
  4. 使用root权限运行

开发环境

Python 2.7.5

作者介绍

yihongfei QQ:413999317

CCIE 38649

寄语

麻雀虽小五脏俱全,为网络自动化运维尽绵薄之力

TODO

  1. 未反应链路的丢包情况
  2. 未反应延时的变化

以后会发布的作品

  1. NCM: 自动备份交换机、路由器的配置
  2. alllogscan:自动检测log文件中的关键字,发送邮件短信报警。例如:交换机、路由器、防火墙、服务器的log不限。
  3. thresholdWarning:自动登录交换机、路由器、防火墙,抓取cpu,端口数值,并实现邮件短信报警。
  4. ChangeVlanbyself:实现自助划分vlan的功能,让非网络人员也可以划分交换机端口,操作简单,内涵4层安全检查,杜绝误操作引起的网络故障。
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].