In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to install and use the server monitoring alarm system Shinken on Ubuntu 16.04. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Shinken is an open source host and network monitoring framework implemented in Python and compatible with Nagios like. It can run on all operating systems that support Python programs, such as Linux, Unix, and Windows. Shinken was written by Jean Gabes to validate a new Nagios architecture idea, but this idea was rejected by the authors of Nagios as an independent network system monitoring software and maintained compatibility with Nagios.
I will describe how to install Shinken from source code compilation and add a Linux host to the monitoring system. I will use the Ubuntu 16.04Xenial Xerus operating system as the Shinken server and the host to monitor.
* step to install Shinken server
Shinken is a Python framework that we can install through pip or from source code. In this step, we will compile and install Shinken with source code.
There are a few more steps we need to complete before we start installing Shinken.
Install some new Python packages and create a system user named shinken:
Sudo apt-get install python-setuptools python-pip python-pycurl useradd-m-s / bin/bash shinken
Download the Shinken source code from the GitHub repository:
Git clone https://github.com/naparuba/shinken.git cd shinken/
Then install Shinken with the following command:
Git checkout 2.4.3 python setup.py install
Then, for better results, we also need to install the python-cherrypy3 package from the Ubuntu software library:
Sudo apt-get install python-cherrypy3
Now that Shinken has been successfully installed, let's add Shinken to the system startup entry and start it:
Update-rc.d shinken defaults systemctl start shinken
Step 2 install Shinken Webui2
Webui2 is Shinken's Web interface (can be found in shinken.io). The easiest way to install Shinken webui2 is to use the shinken CLI command (which must be executed as the shinken user).
Switch to the shinken user:
Su-shinken
Initialize the shiken configuration file, and the following command will create a new configuration file .shinken.ini:
Shinken-init
Next, install webui2 with the shinken CLI command:
Shinken install webui2
Webui2 has been installed at this point, but we also need to install MongoDB and use pip to install another Python package. Run the following command under root:
Sudo apt-get install mongodb pip install pymongo > = 3.0.3 requests arrow bottle==0.12.8
Next, change to the shinken directory and add the new webui2 module by editing the broker-master.cfg file:
Cd / etc/shinken/brokers/ vim broker-master.cfg
Add a module option on line 40:
Modules webui2
Save the file and exit the editor.
Now go to the contacts directory and edit admin.cfg for administrative configuration.
Cd / etc/shinken/contacts/ vim admin.cfg
Modify as follows:
Contact_name admin # Username 'admin' password yourpass # Pass' mypass'
Save and exit.
Step 3 install the Nagios plug-in and Shinken package
In this step, we will install the Nagios plug-in and some Perl modules. Then install other software packages from shinken.io for monitoring.
Install the Nagios plug-in and the cpanminus required to install the Perl module:
Sudo apt-get install nagios-plugins* cpanminus
Install the Perl module with the cpanm command.
Cpanm Net::SNMP cpanm Time::HiRes cpanm DBI
Now we create a directory linked to shinken for the utils.pm file, and create a new log directory for Log_File_Health.
Chmod Utility / usr/lib/nagios/plugins/check_icmp ln-s / usr/lib/nagios/plugins/utils.pm / var/lib/shinken/libexec/ mkdir-p / var/log/rhosts/ touch / var/log/rhosts/remote-hosts.log
Then, install the shinken packages ssh and linux-snmp from shinken.io to monitor SSH and SNMP:
Su-shinken shinken install ssh shinken install linux-snmp
Step 4: add a Linux host host-one
We will add a new Linux host to be monitored with an IP address of 192.168.1.121 and a host name of Ubuntu 16.04 with the name host-one.
Connect to the host-one host:
Ssh host1@192.168.1.121
Install the snmp and snmpd packages from the Ubuntu software library:
Sudo apt-get install snmp snmpd
Then, edit the snmpd.conf configuration file with vim:
Vim / etc/snmp/snmpd.conf
Comment out line 15 and uncomment line 17:
# agentAddress udp:127.0.0.1:161 agentAddress udp:161,udp6: [:: 1]: 161
Comment out lines 51 and 53, and then add a new configuration as follows:
# rocommunity mypass default-V systemonly # rocommunity6 mypass default-V systemonly rocommunity mypass
Save and exit.
Now start the snmpd service with the systemctl command:
Systemctl start snmpd
Define a new host on the shinken server by creating a new file under the hosts folder:
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-must be the same password you used in the client snmpd configuration file:
$SNMPCOMMUNITYREAD$=mypass
Save and exit.
Now restart both the server and the client:
Reboot
Now the Linux host has been successfully added to the shinken server.
Step 5 visit Shinken Webui2
Access Shinken webui2 on port 7677 (replace IP in URL with your own IP address):
Http://192.168.1.120:7767
Log in with the administrator user and password (what you set in the admin.cfg file)
Shinken panel in Webui2:
Two of our servers are being monitored by Shinken:
List all services that are monitored by linux-snmp:
Status information for all hosts and services:
Step 6 frequently asked questions about Shinken
Issues related to the NTP server
When you get the following NTP error prompt
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 them with:
# 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 iburst pool 0.id.pool.ntp.org pool 1.asia.pool.ntp.org pool 0.asia.pool.ntp.org
Then, add the following restriction rule to the new line:
# Local users may interrogate the ntp server more closely. Restrict 127.0.0.1 restrict 192.168.1.120 # shinken server IP address restrict:: 1 NOTE: 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 Found problem
Download the source code from the github repository to the shinken library directory:
Cd / var/lib/shinken/libexec/ wget https://raw.githubusercontent.com/Sysnove/shinken-plugins/master/check_netint.pl chmod + x check_netint.pl chown shinken:shinken check_netint.pl
The problem of network occupation
This is an error message:
ERROR: Unknown interface eth\ d +
Check your network interface and edit the linux-snmp template.
On my Ununtu server, the network card is "enp0s8", not eth0, so I encountered this error.
Vim edits linux-snmp templates:
Vim / etc/shinken/packs/linux-snmp/templates.cfg
Add network interface information on line 24:
_ NET_IFACES eth\ d+ | em\ d+ | enp0s8
Save and exit.
Thank you for reading! This is the end of the article on "how to install and use the server monitoring alarm system Shinken on Ubuntu 16.04". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.