温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Ubuntu 12.04 x64怎么安装nagios

发布时间:2021-07-24 15:02:05 来源:亿速云 阅读:120 作者:chen 栏目:移动开发

这篇文章主要讲解了“Ubuntu 12.04 x64怎么安装nagios”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Ubuntu 12.04 x64怎么安装nagios”吧!

一.安装fetion的支持文件(由于fetion需要32位libgssapi-krb5的so包,所以安装的时候文件名称后面加:1386)

ubuntu@ubuntu:~$sudo apt-get  install  zlib1g-dev libkrb5* libgssapi-krb5-2:i386 lib32z1  lib32stdc++6 -y

二.下载fetion程序文件

ubuntu@ubuntu:~$ wget http://www.it-adv.net/fetion/downng/fetion20091117-linux.tar.gz

ubuntu@ubuntu:~$ tar zxvf fetion20091117-linux.tar.gz

ubuntu@ubuntu:~$ mv fx/ /usr/local/fetion

ubuntu@ubuntu:~$ cd /usr/local/fetion/

ubuntu@ubuntu:/usr/local/fetion$ ls

cache  commands  done  fetion  libACE-5.7.2.so  libACE_SSL-5.7.2.so  libcrypto.so.4  libeay32.dll  libssl.so.4  logs  plugins

ubuntu@ubuntu:/usr/local/fetion$ sudo vim /etc/ld.so.conf

include /etc/ld.so.conf.d/*.conf

/usr/local/fetion

ubuntu@ubuntu:/usr/local/fetion$ sudo ldconfig

三.由于fetion20091117-linux.tar.gz文件里面的fetion文件已经被作者更新,无法使用,所以要重官网下载fetion最新文件,文件下载网址(http://bbs.it-adv.net/viewthread.php?tid=1081&extra=page%3D1)(注意:此网址不能直接点击打开,要拷贝到浏览器里面打开)

Ubuntu 12.04 x64怎么安装nagios

ubuntu@ubuntu:~$ chmod +x fetion

ubuntu@ubuntu:~$ sudo mv fetion /usr/sbin/

ubuntu@ubuntu:~$ sudo cp /usr/sbin/fetion /usr/local/fetion/

四.下载更新后的库文件

ubuntu@ubuntu:~$ wget http://www.it-adv.net/fetion/linuxso_20101113.rar

ubuntu@ubuntu:~$ sudo apt-get install unrar -y

ubuntu@ubuntu:~$ unrar x linuxso_20101113.rar                  

Ubuntu 12.04 x64怎么安装nagios

ubuntu@ubuntu:~$ sudo cp libACE* libcrypto.so.4 libssl.so.4 /usr/local/fetion/

五.安装完成之后测试,输入完验证码就可以正常发送短信

ubuntu@ubuntu:~$ sudo fetion --mobile=13918016506 --pwd=Aiyou1234  --to=13918016506,13918016506 --msg-utf8="hello world"Ubuntu 12.04 x64怎么安装nagios

要求输入验证码,验证码的路径在/usr/sbin路径下,由于是图片下载到本地查看

Ubuntu 12.04 x64怎么安装nagios

六.nagios配置配置飞信报警

Configuration contacts.cfg

define contact (
contact_name                               admin
alias system                                   admin
host_notification_period                 24x7
service_notification_period              24x7
host_notification_options                d, r
service_notification_options             c, w, r
service_notification_commands        notify-service-by-fetion
host_notification_commands            notify-host-by-fetion
pager                                           139xxxxxxxxx
)
Configuration miscommands.cfg file
define command (
command_name       notify-host-by-fetion
command_line          /usr/sbin/fetion --mobile=139xxxxxxxx --pwd=xxxxxxxx --to=$CONTACTPAGER$ --msg-utf8="Host $ HOSTSTATE $ alert for $ HOSTNAME $! on '$ LONGDATETIME $'"
)
define command (
command_name      notify-service-by-fetion
command_line         /usr/sbin/fetion --mobile=139xxxxxxxx --pwd=xxxxxxxx --to=$CONTACTPAGER$ --msg-utf8="$ HOSTADDRESS $ $ HOSTALIAS $ / $ SERVICEDESC $ is $ SERVICESTATE $ on $ LONGDATETIME $"
)

七.工作总结

1.ubuntu上的安装包,尽量用apt-get安装,deb下载的包用dpkg -i安装可能造成版本不一致。无法正常使用apt-get

2.ubuntu 64的系统安装32位系统的deb包时,可以在安装文件名后面加:1386,如libgssapi-krb5-2:i386

3.飞信安装完成之后,执行(sudo fetion --mobile=13918016506 --pwd=Aiyou1234  --to=13918016506,13918016506 --msg-utf8="hello world"),第一次使用的时候要加sudo,因为fetion在/usr/sbin目录下,第一次使用不加sudo没有权限生成验证码。

4.如果执行了( sudo fetion --mobile=13918016506 --pwd=Aiyou1234  --to=13918016506,13918016506 --msg-utf8="hello world")这条命令,没有生成验证码,就直接结束了,那说明so库文件或者fetion文件没有更新,还是2010年前的文件,需要更新,可以在这条命令后面加--debug查看原因!

感谢各位的阅读,以上就是“Ubuntu 12.04 x64怎么安装nagios”的内容了,经过本文的学习后,相信大家对Ubuntu 12.04 x64怎么安装nagios这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI