首页 / IOS / Nagios监控打印机
Nagios监控打印机
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Nagios监控打印机,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2250字,纯文字阅读大概需要4分钟。
内容图文
![Nagios监控打印机](/upload/InfoBanner/zyjiaocheng/1171/a230eb72d8944fb6ac5f2278bf74a229.jpg)
Nagios以为其良好的状态检测机制,使Nagios可以利用在不同平台上的不同插件实现监控,当然它也支持使用SNMP协议(简单网络管理协议)实现各个平台和设备的监控,所以Nagios也可以使用SNMP协议来监控局域网内的打印机,Nagios监控打印机是使用check_hpjd工具调用SNMP协议来监控打印机的,在安装好的Nagios中的libexec插件目录下可能没有,是因为服务器上没有安装SNMP协议相关的依赖包net-snmp和net-snmp-utils,所以可以直接用yum或者是apt安装下,再重新编译下nagios-plugins,有一点像Nagios没有安装MySQL时没有check_mysql一样,操作如下:
[root@localhost nagios-plugins-2.2.1]# yum -y install net-snmp net-snmp-utils [root@localhost nagios-plugins-2.2.1]# ./configure --with-nagios-user=nagios --with-nagios-group=nagios [root@localhost nagios-plugins-2.2.1]# make && make install
此时再看libexec插件目录下就有check_hpjd插件,打印机的监控方式有点类似于Nagios监控Windows上的NSClient++,可以参看http://jim123.blog.51cto.com/4763600/1956790,在Nagios配置好后就有打印的配置模板,同NSClient++中一样修改下模板:
/usr/local/nagios/etc/objects/printer.cfg define hostgroup{ hostgroup_name network-printers alias Network Printers } ######################################################################################## /usr/local/nagios/etc/servers/192.168.1.254.cfg define host{ use generic-printer ; Inherit default values from a template host_name hplj200 ; The name we‘re giving to this printer alias HP LaserJet 200dn ; A longer name associated with the printer address 192.168.1.254 ; IP address of the printer hostgroups network-printers ; Host groups this printer is associated with contact_groups admins } define service{ use generic-service ; Inherit values from a template host_name hplj200 ; The name of the host the service is associated with service_description Printer Status ; The service description check_command check_hpjd!-C public ; The command used to monitor the service check_interval 10 ; Check the service every 10 minutes under normal conditions retry_interval 1 ; Re-check the service every minute until its final/hard state is determined max_check_attempts 2 notifications_enabled 1 } define service{ use generic-service host_name hplj200 service_description PING check_command check_ping!3000.0,80%!5000.0,100% check_interval 10 retry_interval 1 max_check_attempts 2 notifications_enabled 1 }
配置好后重启Nagios后就可以实现打印机的监控650) this.width=650;" src="/upload/getfiles/default/2022/11/7/20221107072025401.jpg" title="printer" />
本文出自 “技术随笔” 博客,谢绝转载!
原文:http://jim123.blog.51cto.com/4763600/1957149
内容总结
以上是互联网集市为您收集整理的Nagios监控打印机全部内容,希望文章能够帮你解决Nagios监控打印机所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。