Install and configure SNMP on RHEL or CentOS
- font size decrease font size increase font size
- Print Email
This guide describe howto install and do a basic configure of SNMP on a RedHat Enterprise Linux or CentOS. Probably it will work on many other *nix systems.
1. Installation
Run command yum install net-snmp-utils
[root@dull etc]# yum install net-snmp-utils Loading "fastestmirror" plugin Loading "dellsysidplugin" plugin ... ... Dependencies Resolved ============================================================================= Package Arch Version Repository Size ============================================================================= Installing: net-snmp-utils i386 1:5.3.1-24.el5_2.2 updates 182 k Installing for dependencies: net-snmp i386 1:5.3.1-24.el5_2.2 updates 698 k Transaction Summary ============================================================================= Install 2 Package(s) Update 0 Package(s) Remove 0 Package(s) Total download size: 879 k Is this ok [y/N]: y
Answer y
Downloading Packages:
(1/2): net-snmp-utils-5.3 100% |=========================| 182 kB 00:02 (2/2): net-snmp-5.3.1-24. 100% |=========================| 698 kB 00:06 Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing: net-snmp ######################### [1/2] Installing: net-snmp-utils ######################### [2/2] Installed: net-snmp-utils.i386 1:5.3.1-24.el5_2.2 Dependency Installed: net-snmp.i386 1:5.3.1-24.el5_2.2 Complete!
Now it is installed
2. Configure
I’m careful so I do a backup of the snmpd config file.
[root@dull ~]# mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.org
Create a new config file.
[root@dull ~]# vi /etc/snmp/snmpd.conf
rocommunity public
syslocation "PDC, Peters DataCenter"
syscontact This email address is being protected from spambots. You need JavaScript enabled to view it.%MINIFYHTML4555b126fe47bc81ab78959d46ca6d9218%
Start the snmpd service
[root@dull ~]# /etc/init.d/snmpd start
Do a snmpwalk to make sure it is working
[root@dull ~]# snmpwalk -v 1 -c public -O e 127.0.0.1
SNMPv2-MIB::sysDescr.0 = STRING: Linux dull 2.6.18-92.1.17.el5 #1 SMP Tue Nov 4 13:45:01 EST 2008 i686
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (16748) 0:02:47.48
SNMPv2-MIB::sysContact.0 = STRING: This email address is being protected from spambots. You need JavaScript enabled to view it.%MINIFYHTML4555b126fe47bc81ab78959d46ca6d9219%SNMPv2-MIB::sysName.0 = STRING: dull
SNMPv2-MIB::sysLocation.0 = STRING: "PDC, Peters DataCentral"
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (1) 0:00:00.01
...
...
Yes, it is working
And finally, make sure snmpd starts next time you restart your machine.
[root@dull ~]# chkconfig snmpd on
3. Monitor example
Below is an example of how it looks using op5 Monitor a Nagios based Enterprise Monitor solution.
( ! ) Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 169 | ||||
---|---|---|---|---|
Call Stack | ||||
# | Time | Memory | Function | Location |
1 | 0.0018 | 412344 | {main}( ) | .../index.php:0 |
2 | 0.0910 | 4262312 | Joomla\CMS\Application\SiteApplication->execute( ) | .../index.php:49 |
3 | 0.0910 | 4262312 | Joomla\CMS\Application\SiteApplication->doExecute( ) | .../CMSApplication.php:196 |
4 | 0.3161 | 11453232 | Joomla\CMS\Application\SiteApplication->dispatch( ) | .../SiteApplication.php:233 |
5 | 0.3167 | 11477560 | Joomla\CMS\Component\ComponentHelper::renderComponent( ) | .../SiteApplication.php:194 |
6 | 0.3175 | 11532888 | Joomla\CMS\Component\ComponentHelper::executeComponent( ) | .../ComponentHelper.php:377 |
7 | 0.3177 | 11560288 | require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ) | .../ComponentHelper.php:402 |
8 | 0.3271 | 11959920 | K2ControllerItem->execute( ) | .../k2.php:64 |
9 | 0.3271 | 11959920 | K2ControllerItem->display( ) | .../BaseController.php:710 |
10 | 0.3413 | 12610624 | K2ControllerItem->display( ) | .../item.php:78 |
11 | 0.3413 | 12610624 | K2ControllerItem->display( ) | .../controller.php:19 |
12 | 0.3467 | 12981664 | Joomla\CMS\Cache\Controller\ViewController->get( ) | .../BaseController.php:663 |
13 | 0.3502 | 13002032 | K2ViewItem->display( ) | .../ViewController.php:102 |
14 | 0.4766 | 15895120 | K2ViewItem->display( ) | .../view.html.php:742 |
15 | 0.4766 | 15895120 | K2ViewItem->loadTemplate( ) | .../HtmlView.php:230 |
16 | 0.4812 | 16068056 | include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ) | .../HtmlView.php:701 |
- Published in SNMP
- Read 2520 times
( ! ) Notice: Only variables should be assigned by reference in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 478 | ||||
---|---|---|---|---|
Call Stack | ||||
# | Time | Memory | Function | Location |
1 | 0.0018 | 412344 | {main}( ) | .../index.php:0 |
2 | 0.0910 | 4262312 | Joomla\CMS\Application\SiteApplication->execute( ) | .../index.php:49 |
3 | 0.0910 | 4262312 | Joomla\CMS\Application\SiteApplication->doExecute( ) | .../CMSApplication.php:196 |
4 | 0.3161 | 11453232 | Joomla\CMS\Application\SiteApplication->dispatch( ) | .../SiteApplication.php:233 |
5 | 0.3167 | 11477560 | Joomla\CMS\Component\ComponentHelper::renderComponent( ) | .../SiteApplication.php:194 |
6 | 0.3175 | 11532888 | Joomla\CMS\Component\ComponentHelper::executeComponent( ) | .../ComponentHelper.php:377 |
7 | 0.3177 | 11560288 | require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ) | .../ComponentHelper.php:402 |
8 | 0.3271 | 11959920 | K2ControllerItem->execute( ) | .../k2.php:64 |
9 | 0.3271 | 11959920 | K2ControllerItem->display( ) | .../BaseController.php:710 |
10 | 0.3413 | 12610624 | K2ControllerItem->display( ) | .../item.php:78 |
11 | 0.3413 | 12610624 | K2ControllerItem->display( ) | .../controller.php:19 |
12 | 0.3467 | 12981664 | Joomla\CMS\Cache\Controller\ViewController->get( ) | .../BaseController.php:663 |
13 | 0.3502 | 13002032 | K2ViewItem->display( ) | .../ViewController.php:102 |
14 | 0.4766 | 15895120 | K2ViewItem->display( ) | .../view.html.php:742 |
15 | 0.4766 | 15895120 | K2ViewItem->loadTemplate( ) | .../HtmlView.php:230 |
16 | 0.4812 | 16068056 | include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ) | .../HtmlView.php:701 |