Install and configure SNMP on RHEL or CentOS

 

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

[[email protected] 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.

[[email protected] ~]# mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.org 

Create a new config file.

[[email protected] ~]# 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.%MINIFYHTMLdf2e54c0646be2f98d6b2f16792697a518%

Start the snmpd service

[[email protected] ~]# /etc/init.d/snmpd start

Do a snmpwalk to make sure it is working

[[email protected] ~]# 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.%MINIFYHTMLdf2e54c0646be2f98d6b2f16792697a519%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.

[[email protected] ~]# 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
#TimeMemoryFunctionLocation
10.0013398296{main}( ).../index.php:0
20.14191348736Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.14191348736Joomla\CMS\Application\SiteApplication->doExecute( ).../CMSApplication.php:196
40.56152792080Joomla\CMS\Application\SiteApplication->dispatch( $component = ??? ).../SiteApplication.php:233
50.56192816544Joomla\CMS\Component\ComponentHelper::renderComponent( $option = 'com_k2', $params = ??? ).../SiteApplication.php:194
60.56362871896Joomla\CMS\Component\ComponentHelper::executeComponent( $path = '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ).../ComponentHelper.php:377
70.56482888952require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php ).../ComponentHelper.php:402
80.57443120776K2ControllerItem->execute( $task = '' ).../k2.php:64
90.57443120776K2ControllerItem->display( $cachable = ???, $urlparams = ??? ).../BaseController.php:710
100.58463359296K2ControllerItem->display( $cachable = TRUE, $urlparams = ['id' => 'INT', 'print' => 'INT', 'lang' => 'CMD', 'Itemid' => 'INT', 'm' => 'INT', 'amp' => 'INT', 'tmpl' => 'CMD', 'template' => 'CMD'] ).../item.php:78
110.58463359296K2ControllerItem->display( $cachable = TRUE, $urlparams = ['id' => 'INT', 'print' => 'INT', 'lang' => 'CMD', 'Itemid' => 'INT', 'm' => 'INT', 'amp' => 'INT', 'tmpl' => 'CMD', 'template' => 'CMD'] ).../controller.php:19
120.58773366432Joomla\CMS\Cache\Controller\ViewController->get( $view = class K2ViewItem { public $document = class Joomla\CMS\Document\HtmlDocument { public $_links = [...]; public $_custom = [...]; public $template = NULL; public $baseurl = NULL; public $params = NULL; public $_file = NULL; protected $_template = ''; protected $_template_tags = [...]; protected $_caching = NULL; private $_html5 = NULL; public $title = 'Install and configure SNMP on RHEL or CentOS'; public $description = '&nbsp; 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...'; public $link = ''; public $base = 'https://www.shan.info/item/366-install-and-configure-snmp-on-rhel-or-centos.html'; public $language = 'en-gb'; public $direction = 'ltr'; public $_generator = 'Joomla! - Open Source Content Management'; public $_mdate = ''; public $_tab = '\t'; public $_lineEnd = '\n'; public $_charset = 'utf-8'; public $_mime = 'text/html'; public $_namespace = ''; public $_profile = ''; public $_scripts = [...]; public $_script = [...]; protected $scriptOptions = [...]; public $_styleSheets = [...]; public $_style = [...]; public $_metaTags = [...]; public $_engine = NULL; public $_type = 'html'; protected $mediaVersion = '15dbf078d61dbbf76811992dd0143dd9' }; protected $_name = 'item'; protected $_models = ['itemlist' => class K2ModelItemlist { ... }, 'item' => class K2ModelItem { ... }]; protected $_basePath = '/var/www/vhosts/shan.info/httpdocs/components/com_k2'; protected $_defaultModel = 'item'; protected $_layout = 'item'; protected $_layoutExt = 'php'; protected $_layoutTemplate = '_'; protected $_path = ['template' => [...], 'helper' => [...]]; protected $_template = '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php'; protected $_output = NULL; protected $_escape = 'htmlspecialchars'; protected $_charset = 'UTF-8'; protected $_errors = []; public $baseurl = ''; public $addLink = NULL; public $inlineCommentsModeration = FALSE; public $item = class stdClass { public $id = '366'; public $title = 'Install and configure SNMP on RHEL or CentOS'; public $alias = 'install-and-configure-snmp-on-rhel-or-centos'; public $catid = '85'; public $published = '1'; public $introtext = '<p>\r\n\t&nbsp;</p>\r\n<p style="margin: 0px; line-height: 18px; color: rgb(113, 113, 113); font-family: arial, verdana, sans-serif; font-size: 12px; text-align: justify;">\r\n\tThis 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.</p>\r\n<h2 style="margin-top: 0px; font-size: 16px; color: rgb(113, 113, 113); font-family: arial, verdana, sans-serif; text-align: justify;">\r\n\t1. Installation</h2>\r\n<p st'; public $fulltext = ''; public $video = NULL; public $gallery = NULL; public $extra_fields = NULL; public $extra_fields_search = ''; public $created = '2013-01-10 18:33:00'; public $created_by = '63'; public $created_by_alias = ''; public $checked_out = '0'; public $checked_out_time = '0000-00-00 00:00:00'; public $modified = '0000-00-00 00:00:00'; public $modified_by = '0'; public $publish_up = '2013-01-10 18:33:00'; public $publish_down = '0000-00-00 00:00:00'; public $trash = '0'; public $access = '1'; public $ordering = '2'; public $featured = '0'; public $featured_ordering = '0'; public $image_caption = ''; public $image_credits = ''; public $video_caption = ''; public $video_credits = ''; public $hits = '2413'; public $params = class Joomla\Registry\Registry { ... }; public $metadesc = ''; public $metadata = 'robots=\nauthor='; public $metakey = ''; public $plugins = ''; public $language = '*'; public $category = class TableK2Category { ... }; public $link = '/item/366-install-and-configure-snmp-on-rhel-or-centos.html'; public $printLink = '/item/366-install-and-configure-snmp-on-rhel-or-centos.html?tmpl=component&amp;print=1'; public $tags = [...]; public $imageXSmall = ''; public $imageSmall = ''; public $imageMedium = ''; public $imageLarge = ''; public $imageXLarge = ''; public $attachments = [...]; public $rawTitle = 'Install and configure SNMP on RHEL or CentOS'; public $author = class Joomla\CMS\User\User { ... }; public $videoType = 'allvideos'; public $text = '<p>\r\n\t&nbsp;</p>\r\n<p style="margin: 0px; line-height: 18px; color: rgb(113, 113, 113); font-family: arial, verdana, sans-serif; font-size: 12px; text-align: justify;">\r\n\tThis 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.</p>\r\n<h2 style="margin-top: 0px; font-size: 16px; color: rgb(113, 113, 113); font-family: arial, verdana, sans-serif; text-align: justify;">\r\n\t1. Installation</h2>\r\n<p st'; public $event = class stdClass { ... }; public $jcfields = [...]; public $image = ''; public $imageWidth = '600'; public $comments = [...]; public $numOfComments = 0; public $previousLink = '/item/363-install-perl-snmp.html'; public $previousTitle = 'install perl snmp'; public $previousImageXSmall = ''; public $previousImageSmall = ''; public $previousImageMedium = ''; public $previousImageLarge = ''; public $previousImageXLarge = ''; public $absoluteURL = 'https://www.shan.info/item/366-install-and-configure-snmp-on-rhel-or-centos.html'; public $langTagForFB = 'en_GB'; public $langTagForTW = 'en-gb'; public $langTagForLI = 'en_GB'; public $sharinglink = 'https://www.shan.info/item/366-install-and-configure-snmp-on-rhel-or-centos.html'; public $socialLink = 'https%3A%2F%2Fwww.shan.info%2Fitem%2F366-install-and-configure-snmp-on-rhel-or-centos.html'; public $twitterURL = 'https://twitter.com/intent/tweet?text=Install+and+configure+SNMP+on+RHEL+or+CentOS&amp;url=https%3A%2F%2Fwww.shan.info%2Fitem%2F366-install-and-configure-snmp-on-rhel-or-centos.html'; public $langTagForGP = ''; public $emailLink = '/component/mailto/?tmpl=component&amp;template=gk_publisher&amp;link=c078a6aad18be66e2d96a3724aecb6ae1de9a873' }; public $user = class Joomla\CMS\User\User { protected $isRoot = FALSE; public $id = 0; public $name = NULL; public $username = NULL; public $email = NULL; public $password = NULL; public $password_clear = ''; public $block = NULL; public $sendEmail = 0; public $registerDate = NULL; public $lastvisitDate = NULL; public $activation = NULL; public $params = NULL; public $groups = [...]; public $guest = 1; public $lastResetTime = NULL; public $resetCount = NULL; public $requireReset = NULL; protected $_params = class Joomla\Registry\Registry { ... }; protected $_authGroups = NULL; protected $_authLevels = [...]; protected $_authActions = NULL; protected $_errorMsg = NULL; protected $userHelper = class Joomla\CMS\User\UserWrapper { ... }; protected $_errors = [...]; public $aid = 0; public $gid = 1 }; public $params = class Joomla\Registry\Registry { protected $data = class stdClass { ... }; protected $initialized = TRUE; public $separator = '.' }; public $pagination = class Joomla\CMS\Pagination\Pagination { public $limitstart = 0; public $limit = 10; public $total = 0; public $prefix = ''; public $pagesStart = 1; public $pagesStop = 0; public $pagesCurrent = 1; public $pagesTotal = 0; public $hideEmptyLimitstart = FALSE; protected $viewall = FALSE; protected $additionalUrlParams = [...]; protected $app = class Joomla\CMS\Application\SiteApplication { ... }; protected $data = NULL } }, $method = 'display', $id = ???, $wrkarounds = ??? ).../BaseController.php:663
130.59003452336K2ViewItem->display( $tpl = ??? ).../ViewController.php:102
140.64536408208K2ViewItem->display( $tpl = NULL ).../view.html.php:742
150.64536408208K2ViewItem->loadTemplate( $tpl = NULL ).../HtmlView.php:230
160.64656610280include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php ).../HtmlView.php:701
  • Published in SNMP
  • Read 2413 times
More in this category: « install perl snmp

( ! ) 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
#TimeMemoryFunctionLocation
10.0013398296{main}( ).../index.php:0
20.14191348736Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.14191348736Joomla\CMS\Application\SiteApplication->doExecute( ).../CMSApplication.php:196
40.56152792080Joomla\CMS\Application\SiteApplication->dispatch( $component = ??? ).../SiteApplication.php:233
50.56192816544Joomla\CMS\Component\ComponentHelper::renderComponent( $option = 'com_k2', $params = ??? ).../SiteApplication.php:194
60.56362871896Joomla\CMS\Component\ComponentHelper::executeComponent( $path = '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ).../ComponentHelper.php:377
70.56482888952require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php ).../ComponentHelper.php:402
80.57443120776K2ControllerItem->execute( $task = '' ).../k2.php:64
90.57443120776K2ControllerItem->display( $cachable = ???, $urlparams = ??? ).../BaseController.php:710
100.58463359296K2ControllerItem->display( $cachable = TRUE, $urlparams = ['id' => 'INT', 'print' => 'INT', 'lang' => 'CMD', 'Itemid' => 'INT', 'm' => 'INT', 'amp' => 'INT', 'tmpl' => 'CMD', 'template' => 'CMD'] ).../item.php:78
110.58463359296K2ControllerItem->display( $cachable = TRUE, $urlparams = ['id' => 'INT', 'print' => 'INT', 'lang' => 'CMD', 'Itemid' => 'INT', 'm' => 'INT', 'amp' => 'INT', 'tmpl' => 'CMD', 'template' => 'CMD'] ).../controller.php:19
120.58773366432Joomla\CMS\Cache\Controller\ViewController->get( $view = class K2ViewItem { public $document = class Joomla\CMS\Document\HtmlDocument { public $_links = [...]; public $_custom = [...]; public $template = NULL; public $baseurl = NULL; public $params = NULL; public $_file = NULL; protected $_template = ''; protected $_template_tags = [...]; protected $_caching = NULL; private $_html5 = NULL; public $title = 'Install and configure SNMP on RHEL or CentOS'; public $description = '&nbsp; 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...'; public $link = ''; public $base = 'https://www.shan.info/item/366-install-and-configure-snmp-on-rhel-or-centos.html'; public $language = 'en-gb'; public $direction = 'ltr'; public $_generator = 'Joomla! - Open Source Content Management'; public $_mdate = ''; public $_tab = '\t'; public $_lineEnd = '\n'; public $_charset = 'utf-8'; public $_mime = 'text/html'; public $_namespace = ''; public $_profile = ''; public $_scripts = [...]; public $_script = [...]; protected $scriptOptions = [...]; public $_styleSheets = [...]; public $_style = [...]; public $_metaTags = [...]; public $_engine = NULL; public $_type = 'html'; protected $mediaVersion = '15dbf078d61dbbf76811992dd0143dd9' }; protected $_name = 'item'; protected $_models = ['itemlist' => class K2ModelItemlist { ... }, 'item' => class K2ModelItem { ... }]; protected $_basePath = '/var/www/vhosts/shan.info/httpdocs/components/com_k2'; protected $_defaultModel = 'item'; protected $_layout = 'item'; protected $_layoutExt = 'php'; protected $_layoutTemplate = '_'; protected $_path = ['template' => [...], 'helper' => [...]]; protected $_template = '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php'; protected $_output = NULL; protected $_escape = 'htmlspecialchars'; protected $_charset = 'UTF-8'; protected $_errors = []; public $baseurl = ''; public $addLink = NULL; public $inlineCommentsModeration = FALSE; public $item = class stdClass { public $id = '366'; public $title = 'Install and configure SNMP on RHEL or CentOS'; public $alias = 'install-and-configure-snmp-on-rhel-or-centos'; public $catid = '85'; public $published = '1'; public $introtext = '<p>\r\n\t&nbsp;</p>\r\n<p style="margin: 0px; line-height: 18px; color: rgb(113, 113, 113); font-family: arial, verdana, sans-serif; font-size: 12px; text-align: justify;">\r\n\tThis 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.</p>\r\n<h2 style="margin-top: 0px; font-size: 16px; color: rgb(113, 113, 113); font-family: arial, verdana, sans-serif; text-align: justify;">\r\n\t1. Installation</h2>\r\n<p st'; public $fulltext = ''; public $video = NULL; public $gallery = NULL; public $extra_fields = NULL; public $extra_fields_search = ''; public $created = '2013-01-10 18:33:00'; public $created_by = '63'; public $created_by_alias = ''; public $checked_out = '0'; public $checked_out_time = '0000-00-00 00:00:00'; public $modified = '0000-00-00 00:00:00'; public $modified_by = '0'; public $publish_up = '2013-01-10 18:33:00'; public $publish_down = '0000-00-00 00:00:00'; public $trash = '0'; public $access = '1'; public $ordering = '2'; public $featured = '0'; public $featured_ordering = '0'; public $image_caption = ''; public $image_credits = ''; public $video_caption = ''; public $video_credits = ''; public $hits = '2413'; public $params = class Joomla\Registry\Registry { ... }; public $metadesc = ''; public $metadata = 'robots=\nauthor='; public $metakey = ''; public $plugins = ''; public $language = '*'; public $category = class TableK2Category { ... }; public $link = '/item/366-install-and-configure-snmp-on-rhel-or-centos.html'; public $printLink = '/item/366-install-and-configure-snmp-on-rhel-or-centos.html?tmpl=component&amp;print=1'; public $tags = [...]; public $imageXSmall = ''; public $imageSmall = ''; public $imageMedium = ''; public $imageLarge = ''; public $imageXLarge = ''; public $attachments = [...]; public $rawTitle = 'Install and configure SNMP on RHEL or CentOS'; public $author = class Joomla\CMS\User\User { ... }; public $videoType = 'allvideos'; public $text = '<p>\r\n\t&nbsp;</p>\r\n<p style="margin: 0px; line-height: 18px; color: rgb(113, 113, 113); font-family: arial, verdana, sans-serif; font-size: 12px; text-align: justify;">\r\n\tThis 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.</p>\r\n<h2 style="margin-top: 0px; font-size: 16px; color: rgb(113, 113, 113); font-family: arial, verdana, sans-serif; text-align: justify;">\r\n\t1. Installation</h2>\r\n<p st'; public $event = class stdClass { ... }; public $jcfields = [...]; public $image = ''; public $imageWidth = '600'; public $comments = [...]; public $numOfComments = 0; public $previousLink = '/item/363-install-perl-snmp.html'; public $previousTitle = 'install perl snmp'; public $previousImageXSmall = ''; public $previousImageSmall = ''; public $previousImageMedium = ''; public $previousImageLarge = ''; public $previousImageXLarge = ''; public $absoluteURL = 'https://www.shan.info/item/366-install-and-configure-snmp-on-rhel-or-centos.html'; public $langTagForFB = 'en_GB'; public $langTagForTW = 'en-gb'; public $langTagForLI = 'en_GB'; public $sharinglink = 'https://www.shan.info/item/366-install-and-configure-snmp-on-rhel-or-centos.html'; public $socialLink = 'https%3A%2F%2Fwww.shan.info%2Fitem%2F366-install-and-configure-snmp-on-rhel-or-centos.html'; public $twitterURL = 'https://twitter.com/intent/tweet?text=Install+and+configure+SNMP+on+RHEL+or+CentOS&amp;url=https%3A%2F%2Fwww.shan.info%2Fitem%2F366-install-and-configure-snmp-on-rhel-or-centos.html'; public $langTagForGP = ''; public $emailLink = '/component/mailto/?tmpl=component&amp;template=gk_publisher&amp;link=c078a6aad18be66e2d96a3724aecb6ae1de9a873' }; public $user = class Joomla\CMS\User\User { protected $isRoot = FALSE; public $id = 0; public $name = NULL; public $username = NULL; public $email = NULL; public $password = NULL; public $password_clear = ''; public $block = NULL; public $sendEmail = 0; public $registerDate = NULL; public $lastvisitDate = NULL; public $activation = NULL; public $params = NULL; public $groups = [...]; public $guest = 1; public $lastResetTime = NULL; public $resetCount = NULL; public $requireReset = NULL; protected $_params = class Joomla\Registry\Registry { ... }; protected $_authGroups = NULL; protected $_authLevels = [...]; protected $_authActions = NULL; protected $_errorMsg = NULL; protected $userHelper = class Joomla\CMS\User\UserWrapper { ... }; protected $_errors = [...]; public $aid = 0; public $gid = 1 }; public $params = class Joomla\Registry\Registry { protected $data = class stdClass { ... }; protected $initialized = TRUE; public $separator = '.' }; public $pagination = class Joomla\CMS\Pagination\Pagination { public $limitstart = 0; public $limit = 10; public $total = 0; public $prefix = ''; public $pagesStart = 1; public $pagesStop = 0; public $pagesCurrent = 1; public $pagesTotal = 0; public $hideEmptyLimitstart = FALSE; protected $viewall = FALSE; protected $additionalUrlParams = [...]; protected $app = class Joomla\CMS\Application\SiteApplication { ... }; protected $data = NULL } }, $method = 'display', $id = ???, $wrkarounds = ??? ).../BaseController.php:663
130.59003452336K2ViewItem->display( $tpl = ??? ).../ViewController.php:102
140.64536408208K2ViewItem->display( $tpl = NULL ).../view.html.php:742
150.64536408208K2ViewItem->loadTemplate( $tpl = NULL ).../HtmlView.php:230
160.64656610280include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php ).../HtmlView.php:701
back to top