Build a printer monitoring server using Nagios

Source: Internet
Author: User
Tags email account mrtg

Build a printer monitoring server using Nagios

Tutorial Background: The company has many HP printers, which are difficult to manage. So I thought about whether I could be a printer monitoring server to quickly respond to all the printer problems. After that, I checked the relevant information on the Internet and set up one, so there was no problem in using it. I shared it with you.

Experiment knowledge: check_hpjd plug-in (this command is a standard component of the Nagios plug-in software release package) can be used to monitor JetDirect compatible printers in SNMP mode. This plug-in can check the following printer status: Paper jam, no paper, offline printer, manual intervention, low ink cartridge, insufficient memory, open shell, output tray full, other...

Experimental System: CentOS 6.6 _ x86_64

Prerequisites: Firewall and selinux are both disabled.

Tutorial Description: there is a total of 1 Host in this experiment, and the IP address is assigned to 192.168.19.79.

1. Install nagios

1. Install with yum:

yum -y install epel*
yum -y install nagios nagios-plugins-all

2. If you need to send an email alert, modify the Administrator email address (optional ):

vim /etc/nagios/objects/contacts.cfg

3. Configure the web login password:

htpasswd -c /etc/nagios/passwd nagiosadmin

4. Start the test:

chkconfig httpd onchkconfig nagios onservice httpd startservice nagios start

Now you can access Nagios through the web. Open http: // 192.168.19.79/nagios and enter your username and password to log in:

2. configure printer monitoring:

1. Edit the main configuration file:

Vim/etc/nagios. cfg -------------------------------------------------------> export _file =/etc/nagios/objects/printer. cfg // remove this line comment

2. Edit printer. cfg:

Vim/etc/nagios/objects/printer. cfg
---------------------------------------------------------->
Define host {// define a printer host. Copy and modify multiple printers.
Use generic-printer
Host_name 31 west
Alias 31-WEST
Address 192.168.4.62
Hostgroups network-printers // Add to a group to facilitate unified configuration below
}




Define host {// define another printing host
Use generic-printer
Host_name 31 east
Alias 31-EAST
Address 192.168.4.61
Hostgroups network-printers
}


Define hostgroup {// define a group
Hostgroup_name network-printers
Alias Network Printers
Members 31 east, 31 west // group member. Here, we write two simple statements. Note the corresponding names.
}


Define service {
Use generic-service
Hostgroup_name network-printers // This method is used by members of this group for monitoring
Service_description Printer Status
Check_command check_hpjd! -C public // use the check_hpjd plug-in to check the printer status

Icationication_interval 1440 // notification interval, in minutes
Normal_check_interval 10 // checks every 10 minutes
Retry_check_interval 1 // an error occurs every 1 minute.
}


Define service {
Use generic-service
Hostgroup_name network-printers
Service_description PING
Check_command check_ping! 3000.0, 80%! 5000.0, 100% // use ping to detect whether the printer is online

Icationication_interval 1440
Normal_check_interval 10
Retry_check_interval 1
}

<----------------------------------------------------------

Service nagios restart

3. Use the web management interface of the printer to set the threshold value:

4. Go to the web interface to view the information:

If there is a problem with the printer, it will appear in the list shown above. Click to view:

5. Configure email sending (optional ):

Yum-y install sendmail
Vim/etc/mail. rc ------------------------------------------------> // Add the following lines: set from = Email account smtp = server address set smtp-auth-user = Email account smtp-auth-password = email password set smtp-auth = login
-------------------------------------------------->
Echo "nagios test mail" | mail-s "nagios" email address // test whether the email address can be sent successfully. Replace the email address with your own address.

After that, you will receive an alert email when the monitoring system starts to trigger an alert!

Now, the experiment has been demonstrated. Thank you!

-------------------------------------- Split line --------------------------------------

Configure Mrtg in Ubuntu to monitor Nginx and server system resources

Use snmp + Mrtg to monitor Linux systems

Mrtg server construction (Network Traffic Monitoring)

Network Monitor Nagios Overview

Nagios construction and Configuration

Build a Nagios monitoring platform in the Nginx Environment

Configure the basic Nagios System on RHEL5.3 (using Nagios-3.1.2)

CentOS 5.5 + Nginx + Nagios monitoring and control terminal installation and Configuration Guide

Install Nagios Core for Ubuntu 13.10 Server

-------------------------------------- Split line --------------------------------------

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.