Nagios監控印表機

來源:互聯網
上載者:User

標籤:nagios   snmp   printer   

   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一樣,操作如下:

[[email protected] nagios-plugins-2.2.1]# yum -y install net-snmp net-snmp-utils[[email protected] nagios-plugins-2.2.1]# ./configure --with-nagios-user=nagios --with-nagios-group=nagios[[email protected] 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.cfgdefine hostgroup{        hostgroup_name  network-printers        alias           Network Printers        }########################################################################################        /usr/local/nagios/etc/servers/192.168.1.254.cfgdefine 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="https://s4.51cto.com/wyfs02/M01/00/0F/wKiom1mVZoyi4kMqAAAau-PMe94393.png-wh_500x0-wm_3-wmp_4-s_483796998.png" title="printer" alt="wKiom1mVZoyi4kMqAAAau-PMe94393.png-wh_50" />

本文出自 “技術隨筆” 部落格,謝絕轉載!

Nagios監控印表機

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.