In this step, we will install the Nagios plug-in and some Perl modules. Then install other software packages from shinken. io for monitoring.
Run the cpanm command to install the Perl module.
Now we create a directory linking the utils. pm file to shinken and create a new log directory for Log_File_Health.
Then install the shinken Software Package ssh and linux-snmp from shinken. io to monitor SSH and SNMP:
Step 4 Add a Linux host-oneWe will add a new Linux host to be monitored. The IP address is 192.168.1.121 and the host name is host-one in Ubuntu 16.04.
Connect to the host-one host:
ssh host1@192.168.1.121
Install the snmp and snmpd software packages from the Ubuntu software library:
sudo apt-get install snmp snmpd
Then, use vim to edit the snmpd. conf configuration file:
vim /etc/snmp/snmpd.conf
Comment out 15th rows and uncomment 17th rows:
#agentAddress udp:127.0.0.1:161agentAddress udp:161,udp6:[::1]:161
Comment out rows 51st and 53, and add a new configuration line, as shown below:
#rocommunity mypass default -V systemonly#rocommunity6 mypass default -V systemonlyrocommunity mypass
Save and exit.
Run the systemctl command to start the snmpd service:
systemctl start snmpd
On the shinken server, create a new file in the hosts folder to define a new host:
cd /etc/shinken/hosts/vim host-one.cfg
Paste the following configuration information:
define host{ use generic-host,linux-snmp,ssh contact_groups admins host_name host-one address 192.168.1.121 _SNMPCOMMUNITY mypass # SNMP Pass Config on snmpd.conf }Save and exit.
Edit the SNMP configuration file on the shinken server.
vim /etc/shinken/resource.d/snmp.cfg
Change public to mypass-the password must be the same as the one you used in the snmpd configuration file on the client:
$SNMPCOMMUNITYREAD$=mypass
Save and exit.
Restart both the server and client:
reboot
Now the Linux host has been successfully added to the shinken server.
Step 5 Access Shinken Webui2Access Shinken webui2 in Port 7677 (replace the IP address in the URL with your own IP address ):
Http: // 192.168.1.120: 7767
Log On with the administrator user and password (the one you set in the admin. cfg file)
Shinken panel in Webui2:
Our two servers are being monitored by Shinken:
List all services monitored by linux-snmp:
Status information of all hosts and services:
FAQ about Shinken in step 1NTP server problemsWhen you get the following NTP error message
TimeSync - CRITICAL ( NTP CRITICAL: No response from the NTP server)TimeSync - CRITICAL ( NTP CRITICAL: Offset unknown )
To solve this problem, install ntp on all Linux Hosts.
sudo apt-get install ntp ntpdate
Edit the ntp configuration file:
vim /etc/ntp.conf
Comment out all pools and replace it:
#pool 0.ubuntu.pool.ntp.org iburst#pool 1.ubuntu.pool.ntp.org iburst#pool 2.ubuntu.pool.ntp.org iburst#pool 3.ubuntu.pool.ntp.org iburstpool 0.id.pool.ntp.orgpool 1.asia.pool.ntp.orgpool 0.asia.pool.ntp.org
Then, add the following restriction rules to the new row:
# Local users may interrogate the ntp server more closely.restrict 127.0.0.1restrict 192.168.1.120 #shinken server IP addressrestrict ::1NOTE: 192.168.1.120 is the Shinken server IP address.
Save and exit.
Start ntp and check the Shinken panel.
ntpd
Check_netint.pl Not FoundDownload the source code from the github repository to the shinken repository directory:
cd /var/lib/shinken/libexec/wget https://raw.githubusercontent.com/Sysnove/shinken-plugins/master/check_netint.plchmod +x check_netint.plchown shinken:shinken check_netint.pl
Network occupation ProblemsThis is the error message:
ERROR : Unknown interface eth/d+
Check your network interface and edit the linux-snmp template.
On my untu server, the NIC is "enp0s8" instead of "eth0", so I encountered this error.
Vim:
vim /etc/shinken/packs/linux-snmp/templates.cfg
Add Network Interface Information in Row 3:
NET_IFACES eth/d+|em/d+|enp0s8
Save and exit.
From: https://linux.cn/article-7821-1.html
Address: http://www.linuxprobe.com/server-monitoring-system.html