monitoring

MySQL return first and last record for consecutive identical results

眉间皱痕 提交于 2019-12-01 23:13:32
问题 I'm using MySQL and have a table called 'results' which stores the outcome of a monitor which determines whether a service is up or down at a specific time. +-----------+------------+---------------------+--------+ | result_id | service_id | time_stamp | result | +-----------+------------+---------------------+--------+ | 1 | 1 | 0000-00-00 00:01:00 | down | | 2 | 1 | 0000-00-00 00:02:00 | up | | 3 | 1 | 0000-00-00 00:03:00 | up | | 4 | 1 | 0000-00-00 00:04:00 | up | | 5 | 1 | 0000-00-00 00

Monitor jenkins jobs health using nagios GUI

陌路散爱 提交于 2019-12-01 22:59:05
I am using check_http plugin for discovering jenkins service(Winstone hosted and Apache hosted) is running or not on hosts on which check_mk_agent is installed. And its been monitored on single ui that is nagios GUI, using following command. ./check_http -H Host_Name -u /api/xml?depth=0 -p 8080 Next step is to parse the jobs on specific jenkins master server using jenkins REST api and monitor each job's health in nagios GUI . Could someone please give me any idea on this so that I can monitor the jenkins jobs on single GUI. Any script or plugin much appreciated. #!/usr/bin/perl use strict; use

MySQL return first and last record for consecutive identical results

依然范特西╮ 提交于 2019-12-01 21:35:47
I'm using MySQL and have a table called 'results' which stores the outcome of a monitor which determines whether a service is up or down at a specific time. +-----------+------------+---------------------+--------+ | result_id | service_id | time_stamp | result | +-----------+------------+---------------------+--------+ | 1 | 1 | 0000-00-00 00:01:00 | down | | 2 | 1 | 0000-00-00 00:02:00 | up | | 3 | 1 | 0000-00-00 00:03:00 | up | | 4 | 1 | 0000-00-00 00:04:00 | up | | 5 | 1 | 0000-00-00 00:05:00 | down | | 6 | 1 | 0000-00-00 00:06:00 | down | | 7 | 1 | 0000-00-00 00:07:00 | up | | 8 | 1 |

Measure service latency with prometheus

ぃ、小莉子 提交于 2019-12-01 21:28:42
问题 I am new to prometheus and grafana... My primary goal is to get the response time per request. For me it seemed to be a simple thing - but whatever I do I do not get the results I require. I need to be able to analyse the service lateny in the last minutes/hours/days. The current implementation I found was a simple SUMMARY (without definition of quantiles) which is scraped every 15s. Is it possible to get the average request latency of the last minute from my prometheus SUMMARY? If YES: How?

Measure service latency with prometheus

廉价感情. 提交于 2019-12-01 18:22:59
I am new to prometheus and grafana... My primary goal is to get the response time per request. For me it seemed to be a simple thing - but whatever I do I do not get the results I require. I need to be able to analyse the service lateny in the last minutes/hours/days. The current implementation I found was a simple SUMMARY (without definition of quantiles) which is scraped every 15s. Is it possible to get the average request latency of the last minute from my prometheus SUMMARY? If YES: How? If NO: What should I do? Currently I am using the following query: rate(http_response_time_sum

How to measure Java thread execution time?

末鹿安然 提交于 2019-12-01 17:02:11
I want to measure thread execution time in Java. Now I'm monitoring thread start and end times, but I think it's not so accurate because thread could be suspended during it execution. This is nontrivial. Your best bet is to use a profiler which can accumulate the actual CPU cycles used. Java MXBeans can provide per-thread CPU time: import java.lang.management.ManagementFactory; import java.lang.management.ThreadMXBean; long nanos = ManagementFactory.getThreadMXBean().getThreadCpuTime(Thread.currentThread().getId()); Use a profiling solutions that supports multiple metrics. We call them

c# Getting Chrome URL's from all tab

老子叫甜甜 提交于 2019-12-01 13:14:14
问题 hi i want to get URL from browsers and for chrome i used these and the is not working getting null exception i think chrome has changed something.. getting error on elm4 == null. using UIAutomation i searched more and all the example are not working ... refrences:- https://stackoverflow.com/a/21799588/5096993 https://social.msdn.microsoft.com/Forums/vstudio/en-US/39bf60a8-2bdc-4aa0-96fb-08dca49cdb06/c-get-all-chrome-urls-opened?forum=csharpgeneral else if (browser == BrowserType.Chrome) { //

How to use inotifywait to watch files within folder instead of folder

蹲街弑〆低调 提交于 2019-12-01 09:05:35
I want to use inotifyway to monitor newly created or moved file within a folder But only the files. Let's say my folder is name "watched_folder_test" and I have a file name "toto.txt". If I use the mv command to move the file to the watched_folder_test I got notify that I want Let's say inside the watched_folder_test I have a folder named foo and I create a file name 'bar.txt". I got the notification that I want. But here is my issue. If I have a folder name foo outside of watched_folder_test and I have a file name bar.txt inside it ( foo/bar.txt ) and I move that entire folder inside watched

How to use inotifywait to watch files within folder instead of folder

梦想的初衷 提交于 2019-12-01 07:06:02
问题 I want to use inotifyway to monitor newly created or moved file within a folder But only the files. Let's say my folder is name "watched_folder_test" and I have a file name "toto.txt". If I use the mv command to move the file to the watched_folder_test I got notify that I want Let's say inside the watched_folder_test I have a folder named foo and I create a file name 'bar.txt". I got the notification that I want. But here is my issue. If I have a folder name foo outside of watched_folder_test

Query for system (not JVM) uptime in Java [duplicate]

隐身守侯 提交于 2019-12-01 06:35:36
This question already has an answer here: Get system uptime in Java 5 answers Is there a OS-neutral method of querying for system (not JVM - I am aware of RuntimeMXBean.getUptime()) uptime in JavaSE 6 ? Thanks Yes and no. There are system specific ways of querying uptime (e.g. uptime on *nix) There are ways to detect the operating system . There is a small finite number of likely operating systems. And you're in a general purpose programming environment, so... so it shoudln't be a big deal that they implement it, since they are writting specific JRE for each platform, which is aware of uptime(