In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to install and use Sensu under Linux. It is very detailed and has certain reference value. Friends who are interested must finish reading it.
Sensu is an open source monitoring framework. Sensu adopts Cpact S structure, which has Sensu Server for sending instructions, data storage and object Sensu Client to be monitored.
Install Sensu condition a Linux system as a server node (CentOS 7 is used in this article)
One or more Linux machines (clients) to monitor
Server-side Sensu requires Redis to be installed. To install Redis, enable the EPEL repository:
$sudo yum install epel-release-y and then install Redis:
$sudo yum install redis-y modify / etc/redis.conf to disable protected mode, listen to each address and set the password:
$sudo sed-I's / ^ protected-mode yes/protected-mode no/g' / etc/redis.conf$ sudo sed-I's / ^ bind 127.0.0.1/bind 0.0.0.0 Redis G' / etc/redis.conf$ sudo sed-I's / ^ # requirepass foobared/requirepass password123/g' / etc/redis.conf enable and start the Redis service:
Sudo systemctl enable redis$ sudo systemctl start redisRedis is now installed and ready to be used by Sensu.
Now let's install Sensu.
First, configure the Sensu repository and install the package:
$sudo tee / etc/yum.repos.d/sensu.repo Let's create the simplest configuration file for Sensu: $sudo tee / etc/sensu/conf.d/api.json and then Configure sensu-api to listen on the local host using port 4567: $sudo tee / etc/sensu/conf.d/redis.json "," port ": 6379," password ":" password123 "} EOF$ sudo tee / etc/sensu/conf.d/transport.json in these two files, we configure Sensu to use Redis as the transport mechanism, as well as the address for Reids listening. The client needs to connect directly to the transport mechanism. Each client needs these two files. $sudo tee / etc/sensu/uchiwa.json in this file, we configure Uchiwa to listen on port 3000 for each address (0.0.0.0). We also configure Uchiwa to use sensu-api (already configured). For security reasons, change the owner of the configuration file you just created: $sudo chown-R sensu:sensu / etc/sensu enable and start the Sensu service: $sudo systemctl enable sensu-server sensu-api sensu-client$ sudo systemctl start sensu-server sensu-api sensu-client$ sudo systemctl enable uchiwa$ sudo systemctl start uchiwa attempts to access the Uchiwa website: http://:3000 for production environments, it is recommended to run RabbitMQ clusters as Transport rather than Redis (although Redis clusters can also be used in production environments) Run multiple Sensu server instances and API instances for load balancing and high availability. Now that Sensu is installed, let's configure the client. To add a new client on the client side, you need to enable the Sensu repository on the client by creating the / etc/yum.repos.d/sensu.repo file. $sudo tee / etc/yum.repos.d/sensu.repo after enabling the repository, install Sensu:$ sudo yum install sensu- y to configure sensu-client, create the same redis.json and transport.json in the server, and the client.json configuration file: $sudo tee / etc/sensu/conf.d/client.json in the name field, specify a name to identify the client (usually the hostname). The environment field helps you filter, while subscriptions defines which monitoring checks the client will perform. Finally, enable and start the service and check in Uchiwa because the client automatically registers: $sudo systemctl enable sensu-client$ sudo systemctl start sensu-clientSensu check Sensu check has two components: a plug-in and a definition. Sensu is compatible with the Nagios inspection plug-in specification, so any checks for Nagios can be used without modification. The check is an executable file that is run by the Sensu client. Checking the definition lets Sensu know how, where, and when to run the plug-in. The client side asked us to install a check plug-in on the client. Remember that this plug-in will be executed on the client. Enable EPEL and install nagios-plugins-http:$ sudo yum install-y epel-release$ sudo yum install-y nagios-plugins-http now let's learn about the plug-in by executing it manually. Try to check the status of the Web server running on the client. It should fail because we are not running the Web server: $/ usr/lib64/nagios/plugins/check_http-I 127.0.0.1connect to address 127.0.0.1 and port 80: Connection refusedHTTP CRITICAL-Unable to open TCP socket, as expected, it failed. The return value of the check execution: $echo $? 2Nagios check plug-in specification defines four return values executed by the plug-in: plug-in return code status 0OK1WARNING2CRITICAL3UNKNOWN with this information, we can now create a check definition on the server.
The server side is on the server machine, create the / etc/sensu/conf.d/check_http.json file:
{"checks": {"check_http": {"command": "/ usr/lib64/nagios/plugins/check_http-I 127.0.0.1", "interval": 10, "subscribers": ["frontend"]} in the command field, use the command we tested earlier. Interval will tell Sensu the frequency of this check, in seconds. Finally, subscribers will define the client that performs the check.
Restart sensu-api and sensu-server and confirm that the new check is available in Uchiwa.
The above $sudo systemctl restart sensu-api sensu-server is all the contents of the article "how to install and use Sensu under Linux". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
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.