通过谷歌日历的通知
nagios-notification-google-calendar的Python项目详细描述
nagios-notification-google-calendar is a Nagios-plugin that send Nagios notifications via google calendar SMS reminder
Attention
谷歌对2015年6月27日之后的日历事件禁用短信通知。因此在这个日期之后这个插件就没用了。
Installation
- 从git存储库获取源代码副本:git clone https://github.com/vint21h/nagios-notification-google-calendar.git。或者从https://github.com/vint21h/nagios-notification-google-calendar/tags下载最新版本。
- 从存储库源树或根用户下的解压存档运行python ./setup.py install。或者使用pip:pip install nagios-notification-google-calendar。
Configuration
- 阅读并理解Nagios文档。
- 创建nagios命令定义如下:
# "host-notify-by-sms" command define command{ command_name notify-host-by-sms command_line /usr/bin/notification_google_calendar.py -u $CONTACTNAME$ -m "Host '$HOSTALIAS$' is $HOSTSTATE$ - Info: $HOSTOUTPUT$" -C $CONTACTADDRESS1$ -t $CONTACTADDRESS2$ } # "service-notify-by-sms" command define command{ command_name notify-by-sms command_line /usr/bin/notification_google_calendar.py -u $CONTACTNAME$ -m "$NOTIFICATIONTYPE$ $HOSTNAME$ $SERVICEDESC$ $SERVICESTATE$ $SERVICEOUTPUT$ $LONGDATETIME$" -C $CONTACTADDRESS1$ -t $CONTACTADDRESS2$ }
- 转到https://code.google.com/apis/console/并创建新项目。
- 为项目启用日历API。
- 为类型为Installed application的项目创建OAuth 2.0客户端ID并下载JSON客户端机密文件。
- 使用您的设置将/usr/share/doc/nagios-notification-google-calendar/notification_google_calendar.ini复制到/etc/nagios。注意:nagios用户必须具有notification_google_calendar.ini读取权限和凭据目录读/写权限。
- 修改联系人定义:
- 将addressX选项添加到联系人google日历id的联系人定义中。
- 将addressX选项添加到联系人首选时区的联系人定义中(以TZ数据库中的可读格式)。这是卑鄙的手段,但我不知道怎样才能做得更好。
- 通过运行notification_google_calendar.py -g-u USERNAMEwhereUSERNAME-nagios联系人名称获取并保存凭据。
- 向服务和主机通知列表中添加用于联系人的命令。
- 为移动设备配置谷歌日历。
Licensing
nagios通知google calendar是免费软件:您可以根据由自由软件基金会(free software foundation)发布的gnu通用公共许可条款(许可证的第3版或(由您选择)任何更高版本)重新分发和/或修改它。 有关完整的许可证文本,请参阅复制文件。
Contacts
项目网站:https://github.com/vint21h/nagios-notification-google-calendar
author:阿列克谢·安德鲁希耶维奇<;vint21h@vint21h.pp.ua>;
有关其他作者列表,请参见作者文件。