成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

Nagios飛信配置

運維 系統運維
Nagios飛信配置:Nagios是一個監控系統運行狀態和網絡信息的監控系統。Nagios能監控所指定的本地或遠程主機以及服務,同時提供異常通知功能等。就比如是以飛信的方式發送。這篇文章主要講的是Nagios飛信配置。

  nagios組合飛信

  1、軟件環境(centos 5為例)

  官網地址:[url]http://www.it-adv.net/[/url]

  支持庫安裝:需要Glibc2.4以上的版本

  2、安裝過程

  支持庫和安裝包內容如下:

  1.   # tar zxvf libraryrh4×32.tar.gz  
  2.  
  3.   libACE-5.6.5.so  
  4.  
  5.   libACE_SSL-5.6.5.so  
  6.  
  7.   libcrypto.so.0.9.7a  
  8.  
  9.   libssl.so.0.9.7a  
  10.  
  11.   # tar zxvf fetion20080522004-linrh4.tar.gz  
  12.  

  我將fetion放在/../nagios/libexec/sms

  把支持庫復制到/usr/lib/目錄下,并作軟鏈接如下:

  1.   cp lib*so* /usr/lib/  
  2.  
  3.   ln -s /usr/lib/libcrypto.so.0.9.7a /usr/lib/libcrypto.so.4  
  4.  
  5.   ln -s /usr/lib/libssl.so.0.9.7a /usr/lib/libssl.so.4  
  6.  

  設定lib庫配置文件

  1.   #vi /etc/ld.so.conf  
  2.  
  3.   #增加一條  
  4.  
  5.   /usr/lib/  
  6.  
  7.   #保存退出后,執行  
  8.  
  9.   #ldconfig  
  10.  
  11.   fetion的目錄結構:  
  12.  
  13.   .\Readme.txt: 本說明文件  
  14.  
  15.   .\fetion:主程序  
  16.  
  17.   .\sound\*.wav:各種音效文件,您可以用自己喜歡的文件替換  
  18.  
  19.   .\plugins\plugin_*: 插件程序,您可以修改插件以達到自己的各性化需求  
  20.  

  完成之后測試,安裝是否成功;執行

  1.   #cd install  
  2.  
  3.   # ./fetion -h  
  4.  
  5.   Usage:  
  6.  
  7.   fetion -h  
  8.  
  9.   -h: help  
  10.  
  11.   fetion -u mobile -p pwd [-b batchfile] [-EN] [-d]  
  12.  
  13.   fetion -u mobile -p pwd [-b batchfile] [-EN] [-d]  
  14.  
  15.   -u: Fetion user account(only supports mobile phone No.)  
  16.  
  17.   -p: Account password  
  18.  
  19.   -b: Batch file name  
  20.  
  21.   -d: Debug and write logs to [mobile]-debug.log  
  22.  
  23.   -EN: English  
  24.  

  3、實際測試

  測試帳號:13888888888

  密碼:123456 (如果密碼中含有特殊字符,請使用單引號)

  如果發送成功。那么飛信安裝過程就OK了

  4、飛信組合nagios

  Fetion以后臺方式啟動:nohup /usr/local/nagios/libexec/sms/fetion -u 13888888888 -p 123456 >/dev/null 2>1 &

  寫一個perl腳本(本腳本由gzmaster小弟提供)

  1.   Sms.pl (/../nagios/libexec/sms/sms.pl)  
  2.  
  3.   #!/usr/bin/perl -w  
  4.  
  5.   use strict;  
  6.  
  7.   use Data::Dumper;  
  8.  
  9.   use LWP::UserAgent;  
  10.  
  11.   my $mesg = shift;  
  12.  
  13.   $mesg =~ s/\//|/g;  
  14.  
  15.   my @number = (接收手機號,接收手機號);  
  16.  
  17.   foreach my $number ( @number ) {  
  18.  
  19.   #print “send sms to $number \n”;  
  20.  
  21.   my $send_sms_url = “http://localhost:40000/API/buddy/sms/” . $number . “/” . $mesg . ‘?rand=0.7394060082921254′;  
  22.  
  23.   my $request = HTTP::Request->new(GET => $send_sms_url);  
  24.  
  25.   my $ua = LWP::UserAgent->new;  
  26.  
  27.   $ua->timeout( 5 );  
  28.  
  29.   $ua->agent(“Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; Maxthon 2.0)”);  
  30.  
  31.   my $response = $ua->request($request);  
  32.  
  33.   my $content = $response->content();  
  34.  
  35.   }  
  36.  

  修改相應的配置文件

  修改用戶及組:contacts.cfg

  添加:

  1.   define contact{  
  2.  
  3.   contact_name sms-members  
  4.  
  5.   use sms-mail-contact  
  6.  
  7.   alias Nagios Admin SMS  
  8.  
  9.   pager 138888888888  
  10.  
  11.   }  
  12.  
  13.   define contactgroup{  
  14.  
  15.   contactgroup_name admins-and-lijs  
  16.  
  17.   alias Nagios Administrators  
  18.  
  19.   members sms-members  
  20.  
  21.   }  
  22.  

  修改報警選項:templates.cfg

  1.   define contact{  
  2.  
  3.   name generic-contact  
  4.  
  5.   service_notification_period 24×7  
  6.  
  7.   host_notification_period 24×7  
  8.  
  9.   service_notification_options w,u,c,r,f,s  
  10.  
  11.   host_notification_options d,u,r,f,s  
  12.  
  13.   service_notification_commands notify-service-by-email; service-notify-by-sms  
  14.  
  15.   host_notification_commands notify-host-by-email  
  16.  
  17.   register 0  
  18.  
  19.   }  
  20.  
  21.   define contact{  
  22.  
  23.   name sms-mail-contact  
  24.  
  25.   service_notification_period 24×7  
  26.  
  27.   host_notification_period 24×7  
  28.  
  29.   service_notification_options w,u,c,r,f,s  
  30.  
  31.   host_notification_options d,u,r,f,s  
  32.  
  33.   service_notification_commands service-notify-by-sms  
  34.  
  35.   host_notification_commands notify-host-by-email  
  36.  
  37.   register 0  
  38.  
  39.   }  
  40.  

  修改調用腳本:commands.cfg

  1.   #host-notify-by-sms  
  2.  
  3.   define command {  
  4.  
  5.   command_name host-notify-by-sms  
  6.  
  7.   command_line /usr/bin/printf “%b” “***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nHost: $HOSTNAME$\nState:  
  8.  
  9.   $HOSTSTATE$\nWAN_IP: $HOSTALIAS$\nLAN_IP: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n” | /usr/local/nagios/lib  
  10.  
  11.   exec/sms.pl 710880931 “** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **” $CONTACTEMAIL$  
  12.  
  13.   }  
  14.  
  15.   #service notify by sms  
  16.  
  17.   define command {  
  18.  
  19.   command_name service-notify-by-sms  
  20.  
  21.   command_line /usr/local/nagios/libexec/sms/sms.pl ‘** $NOTIFICATIONTYPE$ alert – $HOSTNAME$ $SERVICEDESC$ is $SERVICESTA  
  22.  
  23.   TE$ info: $SERVICEOUTPUT$’  
  24.  
  25.   }  
  26.  

  測試下nagios情況。然后再測試報警。Nagios飛信配置就OK了。

【編輯推薦】

Nagios報錯notify-by-email解決

Nagios配置文件的結構

配置Nagios監控Oracle服務器

責任編輯:zhaolei 來源: nagiostutorial
相關推薦

2011-03-23 13:32:14

Nagios飛信

2011-03-23 09:07:49

Nagios飛信

2011-03-25 13:10:08

2011-03-24 10:08:42

Nagios飛信Linux

2010-05-31 09:06:12

Nagios飛信

2011-03-23 12:55:51

NagiosMSN飛信

2011-03-24 13:00:31

Nagios飛信

2011-03-31 16:05:18

Redhat配置nagios

2011-08-22 12:25:02

nagios

2011-11-08 21:58:01

Nagios 配置 流

2011-03-25 16:49:33

nagios服務

2011-03-25 10:37:17

2011-03-23 09:07:50

Nagios短信

2011-03-21 09:17:06

Nagios

2010-05-31 11:10:37

Nagios pnp

2010-05-31 12:22:13

Nagios pnp

2011-03-23 14:43:10

Nagiosnagios.cfg

2011-03-31 16:05:18

Redhat配置nagios

2011-03-22 10:10:21

Nagios配置

2011-03-28 11:03:09

配置Nagios
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 香蕉视频黄色 | 黄色欧美大片 | 亚洲精品成人 | 成人av一区二区三区 | 亚洲欧洲一区 | 美女131mm久久爽爽免费 | 久久久久久亚洲精品 | 亚洲欧美综合精品久久成人 | 亚洲综合成人网 | 国产精品高潮呻吟 | 久久久日韩精品一区二区三区 | 亚洲欧美日韩一区二区 | 亚洲欧美日韩电影 | 欧美日韩不卡 | 欧美色成人 | 免费xxxx大片国产在线 | 97成人免费 | 台湾佬久久 | 日韩免费视频 | 成人精品久久日伦片大全免费 | 国产一区二区三区在线免费观看 | 亚洲一区精品视频 | 成人一级毛片 | 黄色av网站在线免费观看 | 亚州春色 | 久热久热| 剑来高清在线观看 | 亚洲一区二区三区四区五区午夜 | 久久成人精品一区二区三区 | 精品日韩一区二区 | 亚洲成人av在线播放 | 日本在线中文 | 精品成人免费一区二区在线播放 | 欧美精品一区二区免费视频 | 久久午夜精品 | 九九久久免费视频 | 免费黄视频网站 | 伊人久久一区二区 | 国产亚洲一区二区精品 | 欧美一级毛片久久99精品蜜桃 | av黄色网 |