In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Today, I will talk to you about how Nagios monitors multiple tomcat services on a web application server through check_http. Many people may not know much about it. In order to make you understand better, the editor summarized the following for you. I hope you can get something according to this article.
How to monitor tomcat in nagios is a relatively simple and complex thing, because it is relatively simple if only one tomcat service of the web application server is running properly; if you want to monitor other tomcat, such as the number of connections, such as jvm memory usage, it is more complicated, and google does not have a suitable monitoring script. If you want to monitor multiple tomcat servers above a web application, and many tomcat services are hopped, you need to do a lot more.
Generally speaking, the tcp tomcat port is used. However, in the case of tomcat's false death, the tcp port is OK, but the web applications deployed in the tomcat can no longer be accessed normally. In this case, you need to use http to monitor the status of the tomcat.
So this paper records how to use http to monitor multiple web application servers on one tomcat server.
1 install the nrpe client on the tomcat web server:
Download the Rpm package from: http://download.csdn.net/detail/mchdba/7493875
1.1 install nrpe client in rpm mode
3 tomcat multi-port monitoring alarm
Tomcat930 port, now add another tomcat8300 port
3.1 add configuration to the nrpe.cfg of the client
[root@webserver root] # vim / etc/nagios/nrpe.cfg
Commander [check _ tomcat_8300_status] = / usr/lib/nagios/plugins/check_http-I 10.xx.xx.10-p 8300-u / xx_xx_xx/index.html-e 200-w 5-c 10
The document requested by the 301 Moved Permanently customer is elsewhere, the new URL is given in the Location header, and the browser should automatically access the new URL.
302 Found is similar to 301, but the new URL should be seen as a temporary replacement, not permanent. Notice that the corresponding status information in HTTP1.0 is "Moved Temporatily".
……
Finally, add the-v parameter debugging to see the detailed information:
[root@webserver OCC_MANAGER_Web] # / usr/lib/nagios/plugins/check_http-H www.xxxx.com-I 10.xx.xx.10-p 8200-u / OCC_REPORT_Web/index.html-v
GET / OCC_REPORT_Web/index.html HTTP/1.0
User-Agent: check_http/v1861 (nagios-plugins 1.4.11)
Connection: close
Host: www.xxxx.com
Http://10.xx.xx.10:8200/OCC_REPORT_Web/index.html is 323 characters
STATUS: HTTP/1.1 302 Found
* HEADER *
Server: Apache-Coyote/1.1
Set-Cookie: ploccSessionId=45CD9C9921A5B89C59FCB2E34FE52734; Path=/
Location: http://www.xxx.com/OCC_SSO_Web/login.htm?redirect=http%3A%2F%2Fwww.xxx.com%2FOCC_REPORT_Web%2Findex.html
Content-Length: 0
Date: Thu, 12 Jun 2014 02:52:45 GMT
Connection: close
* CONTENT *
HTTP OK-HTTP/1.1 302 Found-0.003 second response time | time=0.003268s;;;0.000000 size=323B;;;0
When you see the page redirected to the domain name system, the tomcat server is running normally, so 302 Found can also indicate that the tomca server is running correctly, because the architecture uses lvs load balancing, so if you use the redirected public domain name to determine whether it is the tomcat of this host, because the public domain name only corresponds to one of the tomcat services at a time, because this is the tomcat that monitors a specific web server. Therefore, it is also a good idea to monitor port 302. Here, you can modify the monitoring command of port 8200 in the client nrpe.cfg to monitor the status value of tomcat:
Vim / etc/nagios/nrpe.cfg
/ usr/lib/nagios/plugins/check_http-I 10.xx.xx.10-p 8200-u / OCC_REPORT_Web/index.html-e 302-w 3-c 10
Error record (1): NRPE: Unable to read output
[1402557345] SERVICE ALERT: webserver;Tomcat_6100_OCC_SSO_Service_Status;UNKNOWN;SOFT;3;NRPE: Unable to read output
Solution: generally speaking, the nrpe path is incorrect.
Error record (2): CHECK_NRPE: Error-Could not complete SSL handshake.
[root@cache-2 etc] # / usr/local/nagios/libexec/check_http-I 10.xx.3.xx-p 8100-u / tradeAdmin/index.html
HTTP OK: HTTP/1.1 302 Found-319 bytes in 0.064 second response time | time=0.064033s;;;0.000000 size=319B;;;0
[root@cache-2 etc] #
[root@cache-2 etc] # / usr/local/nagios/libexec/check_nrpe-H 10.xx.3.xx-c check_load
CHECK_NRPE: Error-Could not complete SSL handshake.
[root@cache-2 etc] #
Solution: there is no nagios server host ip address added in / etc/nagios/nrpe.cfg
Vim / etc/nagios/nrpe.cfg
Allowed_hosts=127.0.0.1,10.xx.xxx.xx1
Then restart nrpe,service nrpe restart; and verify OK on the nagios server:
[root@cache-2 etc] # / usr/local/nagios/libexec/check_nrpe-H 10.xx.3.xx-c check_load
OK-load average: 0.43,0.17,0.06 | load1=0.430;15.000;30.000;0; load5=0.170;10.000;25.000;0; load15=0.060;5.000;20.000;0
[root@cache-2 etc] #
After reading the above, do you have any further understanding of how Nagios monitors multiple tomcat services on a web application server through check_http? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
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.