•  Home
  •  Dashboard
  •  Company
    • About Us
    • Blog
    • Careers
    • Contact Us
    • Data Centers
    • Looking Glass
    • Network
    • Reseller
  •  Hosting Services
    • Backup
    • Content Delivery Network
    • Colocation Hosting
    • Dedicated Hosting
    • DDoS Mitigation
    • IP Transit
    • Private Cloud
    • Wavelength
  •  Solutions
    • Ecommerce
    • Finance
    • Gaming
    • Hosting
    • Management
    • Security
    • System Integrator
  •  Support
    • Community
    • Knowledge Base
    • Open A Ticket
  •  USA & Canada: 800-933-1517
  •  International: 626-549-2801
  •  Email: sales@psychz.net
  • Services
    • Dedicated Servers
    • Colocation
    • Private Cloud
    • DDos Protection
    • IP Transit
    • CDN
    • Backup
  • Solutions
    • Ecommerce
    • Security
    • Gaming
    • Hosting
    • Management
    • Finance
    • System Integrator
  • Dashboard

Configure Nagios snmp monitoring

  • Home
  • Client
  • Qa Forum
  • Configure Nagios snmp monitoring

Posted By: Lachlan | 1 Replies | Last Reply On: Oct 12, 2017 04:13:42

How to configure SNMP monitoring for Nagios? 

Psychz - Raviteja

Votes: 6Posted On: Oct 12, 2017 04:13:42
 

Hi! We will guide you through the process of configuring Nagios for SNMP monitoring. We are assuming that you have Nagios Core and Plugins installed and configured on your server. Also, the host on which you want the SNMP monitoring should also be configured on the host server before configuring SNMP.   

 

Prerequisites 

1. Operating System - CentOS 7 

2. Nagios Core(Latest stable version) - Installed and configured. Please visit the following link to install Nagios Core and Nagios Plugins on CentOS 7. 

https://www.psychz.net/client/question/en/how-to-install-nagios-on-linux-step-by-step.html

3. Nagios Plugin should be installed

4. Host to be monitored - The remote host to be monitored should also be configured on the server.  

 

 

SNMP Installation

1. Install SNMP on your CentOS operating system.

yum install net-snmp -y

 

2. Once the SNMP is installed, the configuration files are stored in "/etc/snmp/snmpd.conf". To be safe, we can create a backup of the file.

mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak

 

3. Next, we have to add the IP address and name to the configuration file. 

rocommunity public IP_address_of_your_server

where "public" is the community name followed by IP address of your server.

 

4. Now start the SNMP service.

service snmpd start

 

5. Set the SNMP service such that it starts on boot.

chkconfig snmpd on

 

 

Configuration of SNMP command block

Before proceeding further, please make sure that the Nagios plugins are installed. You can visit the following link to install plugins. Please check that "/usr/local/nagios/libexec/check_snmp" exists or the plugin is not installed correctly.

https://www.psychz.net/client/question/en/how-to-install-nagios-on-linux-step-by-step.html

 

In this part of the setup, we will create a command line for SNMP monitoring. The SNMP commands are stored in "/usr/local/nagios/etc/objects/commands.cfg". Under this file, you will find the format of SNMP command. Here is a sample of the same.


define command{
        command_name    check_snmp
        command_line    $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$
} 

 

 

CPU Load check of Remote Server

On the basis of this format, we define three commands that perform SNMP checks at an interval of 1 and 15 minutes respectively.


define command{
        command_name    snmp_load_1m
        command_line    $USER1$/check_snmp -o .1.3.6.1.4.1.2021.10.1.3.1 -H $HOSTADDRESS$ $ARG1$
}
 
define command{
        command_name    snmp_load_15m
        command_line    $USER1$/check_snmp -o .1.3.6.1.4.1.2021.10.1.3.3 -H $HOSTADDRESS$ $ARG1$
}


These commands create the SNMP checks with the appropriate OIDs. 
(Note: OIds are Object IDs each designed to perform a specific task.)


Now, open the host configuration file that you must have created at the time of adding a host to the Nagios server. To the host configuration file, please add the following service checks.


define service{
        use                     generic-service
        host_name               test.linux.com
        service_description     CPU load One Minute Interval
        check_command           snmp_load_1m!-C public
}
 
define service{
        use                     generic-service
        host_name               test.linux.com
        service_description     CPU load Fifteen Minute Interval
        check_command           snmp_load_15m!-C public
}


Here is a description of all the fields in "define service block".

1. Use - The category of the service

2. host_name - The host on which the service is to be monitored.

3. service_description - The brief description of service

4. check_command  - The check command used. (Note: THe -C is used for adding the community)

Similarly, you can perform SNMP check on other system maintenance tasks such as Disk Usage, RAM usage, System Uptime among others.

Was this reply helpful?

Related topics

  • PDU recommendation with SNMP and port power monitoring
  • Best Open Source Monitoring Tools For Server
  • How does Nagios monitoring work?
  • How to do PDU monitoring for colocation?
  • How to configure an IP range on Centos 7?
  • The ELK Stack: Elasticsearch, Logstash, Kibana.
  • How to monitor MySQL using Nagios?
  • Community Strings For Psychz Networks
  • What is IPMI? Benefits and Drawbacks?
  • Power distribution inside Data Center
  • DDoS Attacks Are Still On The Rise
  • Firewalld commands for CentOS 7 and CentOS 8
  • Tools That Make Kubernetes Easier
  • Why Gaming Companies are Choosing Bare Metal Servers
  • Best Open-Source Software For Linux Users
Hosting Services
  • Dedicated Hosting
  • Colocation Hosting
  • Backup
  • IP Transit
  • DDoS Mitigation
Support
  • Portal Login
  • Knowledgebase
  • Community
Company
  • About Us
  • Contact Us
  • Network
  • Data Centers
  • Looking Glass
  • Affiliates
  • Reseller
  • Blog
Policies
  • Privacy Policy
  • Acceptable Usage Policy
  • Terms and Conditions
  • Service Level Agreement
Company
  • Psychz Networks,
    A Profuse Solutions Company
    611 Wilshire Blvd #300
    Los Angeles,California 90017
    USA
  • US/Canada: 800-933-1517
  • International: 626-549-2801
Subscribe to Our Mailing List
* indicates required
Copyright © 2023 Psychz Networks, A Profuse Solutions Inc Company