Gebruikershulpmiddelen

Site-hulpmiddelen


werkinstructies:snmp:monitoring_centos7

Dit is een oude revisie van het document!


een CentOS7 server monitoren met snmp

installatie

installer de nodige software door:

yum install net-snmp snmp-utils

firewall

Zet de firewall open:

firewall-cmd --permanent --add-port=161/udp
firewall-cmd --permanent --add-port=162/udp
firewall-cmd --reload

configuratie

pas de configuratie aan:

vi /etc/snmp/snmpd.conf

Zet de betreffende regels als volgt:

rocommunity  public

####
# First, map the community name "public" into a "security name"
#       sec.name       source        community
com2sec notConfigUser  default       public

####
# Second, map the security name into a group name:
#       groupName        securityModel   securityName
group   notConfigGroup   v1              notConfigUser
group   notConfigGroup   v2c             notConfigUser

####
# Third, create a view for us to let the group have rights to:
#       name           incl/excl     subtree         mask(optional)
view    allview        included      .1

####
# Finally, grant the group read-only access to the systemview view.

#       group           context sec.model sec.level prefix read    write  notif
access  notConfigGroup  ""      any       noauth    exact  allview none   none

##       sec.name   source              community
com2sec  mynetwork  192.168.1.0/24      public

##     group.name sec.model  sec.name
group  MyROGroup  v2c        mynetwork
 
##                context sec.model sec.level prefix    read    write    notif
access MyROGroup   ""     any       noauth    exact      all    none   none

Om een proces en een directory te monitoren voeg je nog toe:

# dit is om het http proces te monitoren met nagios via snmp
proc httpd 10 1

# dit is om de root partitie te bewaken
disk / 100000

#dit is om de load te bewaken
load 12 14 14


op de Nagios server

test op de nagios server of de snmp waarden uit te lezen zijn:

snmpwalk -v 1 name-of-server.auriel.nl -c public .1.3.6.1.4.1.2021.9

die moet een waarde geven:



FIXME

werkinstructies/snmp/monitoring_centos7.1472029336.txt.gz · Laatst gewijzigd: 2016/08/24 11:02 door abel