This repository has been archived by the owner on Jan 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtestdata
66 lines (54 loc) · 25.9 KB
/
testdata
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
$ ./check_nsc_web -v -u http://1.2.3.10:8443 -p 012345678901 -t 30
REQUEST:
"GET / HTTP/1.1\r\nHost: 1.2.3.10:8443\r\nUser-Agent: Go-http-client/1.1\r\nPassword: 012345678901\r\nAccept-Encoding: gzip\r\n\r\n"
RESPONSE:
"HTTP/1.0 200 200\r\nConnection: close\r\nContent-Length: 5581\r\nContent-Type: text/html\r\n\r\n<!DOCTYPE html>\r<html lang=\"en\">\r\t<head>\r\t\t<script type=\"text/javascript\">\r\t\t\tglobal_token='';\r\t\t</script>\r\r\t\t<meta charset=\"utf-8\" />\r\t\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" />\r\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\r\r\t\t\r\t\t<link rel=\"shortcut icon\" href=\"/static/images/favicon.png\" />\r\t\r\t\t<link rel=\"stylesheet\" href=\"/static/css/bootstrap.min.css\" />\r\t\t<link rel=\"stylesheet\" href=\"/static/css/bootstrap-dialog.min.css\" />\r\t\t<link rel=\"stylesheet\" href=\"/static/css/bootstrap-select.min.css\" />\r\t\t<link rel=\"stylesheet\" href=\"/static/css/select2.css\" />\r\t\t<link rel=\"stylesheet\" href=\"/static/css/select2-bootstrap.css\" />\r\t\t<link rel=\"stylesheet\" href=\"/static/css/font-awesome.min.css\" />\r\t\t<link rel=\"stylesheet\" href=\"/static/css/nscp.css\" />\r\t\t<script type=\"text/javascript\" src=\"/static/js/lib/require-2.1.18.js\" data-main=\"static/js/main\"></script>\r\r\t\t<title>NSClient++</title>\r\t</head>\r\t<body>\r\t\t<div class=\"container\">\r\t\t\t<nav class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\r\t\t\t\t<div class=\"container\">\r\t\t\t\t\t<!-- Brand and toggle get grouped for better mobile display -->\r\t\t\t\t\t<div class=\"navbar-header\">\r\t\t\t\t\t\t<button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\"#bs-example-navbar-collapse-1\">\r\t\t\t\t\t\t\t<span class=\"sr-only\">Toggle navigation</span>\r\t\t\t\t\t\t\t<span class=\"icon-bar\"></span>\r\t\t\t\t\t\t\t<span class=\"icon-bar\"></span>\r\t\t\t\t\t\t\t<span class=\"icon-bar\"></span>\r\t\t\t\t\t\t</button>\r\t\t\t\t\t\t<a class=\"navbar-brand\" href=\"#/\">NSClient++</a>\r\t\t\t\t\t</div>\r\t\t\t\t\t\r\t\t\t\t\t<!-- Collect the nav links, forms, and other content for toggling -->\r\t\t\t\t\t<div class=\"collapse navbar-collapse\" id=\"bs-example-navbar-collapse-1\">\r\t\t\t\t\t\t<ul class=\"nav navbar-nav\">\r\t\t\t\t\t\t\t<li data-bind=\"css: { active: tab() == 'index' }\">\r\t\t\t\t\t\t\t\t<a href=\"#/\">Home</a>\r\t\t\t\t\t\t\t</li>\r\t\t\t\t\t\t\t<li data-bind=\"css: { active: tab() == 'modules' }\">\r\t\t\t\t\t\t\t\t<a href=\"#/modules\">Modules</a>\r\t\t\t\t\t\t\t</li>\r\t\t\t\t\t\t\t<li data-bind=\"css: { active: tab() == 'settings' }\">\r\t\t\t\t\t\t\t\t<a href=\"#/settings\"> Settings</a>\r\t\t\t\t\t\t\t</li>\r\t\t\t\t\t\t\t<li data-bind=\"css: { active: tab() == 'queries' }\">\r\t\t\t\t\t\t\t\t<a href=\"#/queries\">Queries</a>\r\t\t\t\t\t\t\t</li>\r\t\t\t\t\t\t\t<li data-bind=\"css: { active: tab() == 'log' }\">\r\t\t\t\t\t\t\t\t<a href=\"#/log\"><span class=\"label label-danger\" data-bind=\"visible: nscp_status.has_issues\"><span class=\"glyphicon glyphicon-warning-sign\"></span></span> Log</a>\r\t\t\t\t\t\t\t</li>\r\t\t\t\t\t\t\t<li data-bind=\"css: { active: tab() == 'console' }\">\r\t\t\t\t\t\t\t\t<a href=\"#/console\">Console</a>\r\t\t\t\t\t\t\t</li>\r\t\t\t\t\t\t</ul>\r\t\t\t\t\t\t<ul class=\"nav navbar-nav navbar-right\">\r\t\t\t\t\t\t\t<li class=\"dropdown\">\r\t\t\t\t\t\t\t\t<a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" data-bind=\"css: { 'label-danger': nscp_status.settings().has_changed() }\">\r\t\t\t\t\t\t\t\t\t<span class=\"fa fa-download\"></span>\r\t\t\t\t\t\t\t\t\tChanges <b class=\"caret\"></b>\r\t\t\t\t\t\t\t\t</a>\r\t\t\t\t\t\t\t<ul class=\"dropdown-menu\">\r\t\t\t\t\t\t\t\t<li>\r\t\t\t\t\t\t\t\t\t<a data-bind=\"click: settings.toggleSaveAlways\">\r\t\t\t\t\t\t\t\t\t<span class=\"fa fa-check-circle-o\" data-bind=\"visible: settings.alwaysSave()\"></span>\r\t\t\t\t\t\t\t\t\t<span class=\"fa fa-circle-o\" data-bind=\"visible: !settings.alwaysSave()\"></span>\r\t\t\t\t\t\t\t\t\tAlways save</a>\r\t\t\t\t\t\t\t\t</li>\r\t\t\t\t\t\t\t\t<!-- ko if: nscp_status.settings().has_changed -->\r\t\t\t\t\t\t\t\t\t<li>\r\t\t\t\t\t\t\t\t\t\t<a data-bind=\"click: settings.saveStore\"><span class=\"fa fa-download\"></span> Save configuration</a>\r\t\t\t\t\t\t\t\t\t</li>\r\t\t\t\t\t\t\t\t\t<li>\r\t\t\t\t\t\t\t\t\t\t<a data-bind=\"click: settings.loadStore\"><span class=\"fa fa-upload\"></span> Undo (reload configuration) </a>\r\t\t\t\t\t\t\t\t\t</li>\r\t\t\t\t\t\t\t\t<!-- /ko -->\r\t\t\t\t\t\t\t</ul>\r\t\t\t\t\t\t\t<li class=\"dropdown\">\r\t\t\t\t\t\t\t\t<a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\"><span class=\"glyphicon glyphicon-globe\"></span> Help <b class=\"caret\"></b></a>\r\t\t\t\t\t\t\t\t<ul class=\"dropdown-menu\">\r\t\t\t\t\t\t\t\t\t<li>\r\t\t\t\t\t\t\t\t\t\t<a href=\"http://www.nsclient.org\"><span class=\"glyphicon glyphicon-globe\"></span> NSClient++ Website</a>\r\t\t\t\t\t\t\t\t\t\t<a href=\"http://docs.nsclient.org\"><span class=\"glyphicon glyphicon-globe\"></span> NSClient++ online Help</a>\r\t\t\t\t\t\t\t\t\t</li>\r\t\t\t\t\t\t\t\t</ul>\r\t\t\t\t\t\t\t</li>\r\t\t\t\t\t\t\t<li class=\"dropdown\" data-bind=\"if: $root.nscp_status.is_loggedin\">\r\t\t\t\t\t\t\t\t<a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\"><span class=\"fa fa-cog\"></span> Control <b class=\"caret\"></b></a>\r\t\t\t\t\t\t\t\t<ul class=\"dropdown-menu\">\r\t\t\t\t\t\t\t\t\t<li>\r\t\t\t\t\t\t\t\t\t\t<a data-bind=\"click: nscp_status.reload\"><span class=\"fa fa-refresh\"></span> Reload</a>\r\t\t\t\t\t\t\t\t\t</li>\r\t\t\t\t\t\t\t\t\t<li>\r\t\t\t\t\t\t\t\t\t\t<a><span class=\"fa fa-power-off\"></span> Shutdown</a>\r\t\t\t\t\t\t\t\t\t</li>\r\t\t\t\t\t\t\t\t</ul>\r\t\t\t\t\t\t\t</li>\r\t\t\t\t\t\t\t<li>\r\t\t\t\t\t\t\t\t<a href=\"#\" data-bind=\"click: $root.nscp_status.logout\"><span class=\"glyphicon glyphicon-log-out\"></span></a>\r\t\t\t\t\t\t\t</li>\r\t\t\t\t\t\t</ul>\r\t\t\t\t\t</div>\r\t\t\t\t</div>\r\t\t\t</nav>\r\r\t\t\t<!-- ko if: nscp_status.is_busy() -->\r\t\t\t\t<div id=\"busy\" class=\"alert alert-dismissible\" data-bind=\"css: { 'alert-warning': nscp_status.busy_warning(), 'alert-info': !nscp_status.busy_warning() }\">\r\t\t\t\t\t<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button>\r\t\t\t\t\t<i data-bind=\"visible: nscp_status.busy_warning()\" class=\"fa fa-warning\"></i>\r\t\t\t\t\t<i data-bind=\"visible: !nscp_status.busy_warning()\" class=\"fa fa-spinner fa-spin\"></i>\r\t\t\t\t\t<strong data-bind=\"text: nscp_status.busy_header\"></strong>\r\t\t\t\t\t<span data-bind=\"text: nscp_status.busy_text\"></span>\r\t\t\t\t</div>\r\t\t\t<!-- /ko -->\r\t\t\t<div id=\"appHost\" class=\"container\" data-bind=\"if: name\">\r\t\t\t\t<!-- ko component: { name: name, params: data } --><!-- /ko -->\r\t\t\t</div>\r\t\t</div>\r\t</body>\r</html>"
OK: NSClient API reachable on http://1.2.3.10:8443
$ ./check_nsc_web -v -u http://1.2.3.20:8443 -p 012345678901 -t 30 check_version
REQUEST:
"GET /query/check_version HTTP/1.1\r\nHost: 1.2.3.20:8443\r\nUser-Agent: Go-http-client/1.1\r\nPassword: 012345678901\r\nAccept-Encoding: gzip\r\n\r\n"
RESPONSE:
"HTTP/1.0 200 200\r\nConnection: close\r\nContent-Length: 125\r\n\r\n{\"header\":{\"source_id\":\"\"},\"payload\":[{\"command\":\"check_version\",\"lines\":[{\"message\":\"0.5.0.62 2016-09-14\"}],\"result\":\"OK\"}]}"
0.5.0.62 2016-09-14
$ ./check_nsc_web -v -u http://1.2.3.30:8443 -p 012345678901 -t 30 check_uptime "warning=uptime < 180s" "critical=uptime < 60s"
REQUEST:
"GET /query/check_uptime?warning=uptime+%3C+180s&critical=uptime+%3C+60s HTTP/1.1\r\nHost: 1.2.3.30:8443\r\nUser-Agent: Go-http-client/1.1\r\nPassword: 012345678901\r\nAccept-Encoding: gzip\r\n\r\n"
RESPONSE:
"HTTP/1.0 200 200\r\nConnection: close\r\nContent-Length: 258\r\n\r\n{\"header\":{\"source_id\":\"\"},\"payload\":[{\"command\":\"check_uptime\",\"lines\":[{\"message\":\"OK: uptime: 3w 4d 00:2h, boot: 2018-11-24 09:12:32 (UTC)\",\"perf\":[{\"alias\":\"uptime\",\"int_value\":{\"critical\":60,\"unit\":\"s\",\"value\":2160168,\"warning\":180}}]}],\"result\":\"OK\"}]}"
OK: uptime: 3w 4d 00:2h, boot: 2018-11-24 09:12:32 (UTC)|'uptime'=2160168s;180;60;;
$ ./check_nsc_web -v -u http://1.2.3.41:8443 -p 012345678901 -t 30 check_memory 'filter=none' 'warning=free_pct < 7' 'crit=free_pct < 3'
REQUEST:
"GET /query/check_memory?filter=none&warning=free_pct+%3C+7&crit=free_pct+%3C+3 HTTP/1.1\r\nHost: 1.2.3.41:8443\r\nUser-Agent: Go-http-client/1.1\r\nPassword: 012345678901\r\nAccept-Encoding: gzip\r\n\r\n"
RESPONSE:
"HTTP/1.0 200 200\r\nConnection: close\r\nContent-Length: 317\r\n\r\n{\"header\":{\"source_id\":\"\"},\"payload\":[{\"command\":\"check_memory\",\"lines\":[{\"message\":\"OK: committed = 3.626GB, physical = 3.78GB\",\"perf\":[{\"alias\":\"committed_free_pct\",\"int_value\":{\"critical\":3,\"value\":74,\"warning\":7}},{\"alias\":\"physical_free_pct\",\"int_value\":{\"critical\":3,\"value\":52,\"warning\":7}}]}],\"result\":\"OK\"}]}"
OK: committed = 3.626GB, physical = 3.78GB|'committed_free_pct'=74;7;3;; 'physical_free_pct'=52;7;3;;
$ ./check_nsc_web -v -u http://1.2.3.42:8443 -p 012345678901 -t 30 check_memory 'filter=none' 'warning=free_pct < 7' 'crit=free_pct < 3'
REQUEST:
"GET /query/check_memory?filter=none&warning=free_pct+%3C+7&crit=free_pct+%3C+3 HTTP/1.1\r\nHost: 1.2.3.42:8443\r\nUser-Agent: Go-http-client/1.1\r\nPassword: 012345678901\r\nAccept-Encoding: gzip\r\n\r\n"
RESPONSE:
"HTTP/1.0 200 200\r\nConnection: close\r\nContent-Length: 326\r\n\r\n{\"header\":{\"source_id\":\"\"},\"payload\":[{\"command\":\"check_memory\",\"lines\":[{\"message\":\"WARNING: committed = 3.81GB, physical = 1.904GB\",\"perf\":[{\"alias\":\"committed_free_pct\",\"int_value\":{\"critical\":3,\"value\":52,\"warning\":7}},{\"alias\":\"physical_free_pct\",\"int_value\":{\"critical\":3,\"value\":4,\"warning\":7}}]}],\"result\":\"WARNING\"}]}"
WARNING: committed = 3.81GB, physical = 1.904GB|'committed_free_pct'=52;7;3;; 'physical_free_pct'=4;7;3;;
$ ./check_nsc_web -v -u http://1.2.3.43:8443 -p 012345678901 -t 30 check_memory 'filter=none' 'warning=free_pct < 7' 'crit=free_pct < 3'
REQUEST:
"GET /query/check_memory?filter=none&warning=free_pct+%3C+7&crit=free_pct+%3C+3 HTTP/1.1\r\nHost: 1.2.3.43:8443\r\nUser-Agent: Go-http-client/1.1\r\nPassword: 012345678901\r\nAccept-Encoding: gzip\r\n\r\n"
RESPONSE:
"HTTP/1.0 200 200\r\nConnection: close\r\nContent-Length: 329\r\n\r\n{\"header\":{\"source_id\":\"\"},\"payload\":[{\"command\":\"check_memory\",\"lines\":[{\"message\":\"CRITICAL: committed = 6.297GB, physical = 2.959GB\",\"perf\":[{\"alias\":\"committed_free_pct\",\"int_value\":{\"critical\":3,\"value\":30,\"warning\":7}},{\"alias\":\"physical_free_pct\",\"int_value\":{\"critical\":3,\"value\":1,\"warning\":7}}]}],\"result\":\"CRITICAL\"}]}"
CRITICAL: committed = 6.297GB, physical = 2.959GB|'committed_free_pct'=30;7;3;; 'physical_free_pct'=1;7;3;;
$ ./check_nsc_web -v -u http://1.2.3.51:8443 -p 012345678901 -t 30 check_cpu 'filter=none' 'time=5m' 'time=15m' 'time=60m' 'warning=load > 90' 'crit=load > 95'
REQUEST:
"GET /query/check_cpu?filter=none&time=5m&time=15m&time=60m&warning=load+%3E+90&crit=load+%3E+95 HTTP/1.1\r\nHost: 1.2.3.51:8443\r\nUser-Agent: Go-http-client/1.1\r\nPassword: 012345678901\r\nAccept-Encoding: gzip\r\n\r\n"
RESPONSE:
"HTTP/1.0 200 200\r\nConnection: close\r\nContent-Length: 4514\r\n\r\n{\"header\":{\"source_id\":\"\"},\"payload\":[{\"command\":\"check_cpu\",\"lines\":[{\"message\":\"OK: CPU load is ok.\",\"perf\":[{\"alias\":\"core 0 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":72,\"warning\":90}},{\"alias\":\"core 1 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":79,\"warning\":90}},{\"alias\":\"core 10 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":42,\"warning\":90}},{\"alias\":\"core 11 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":18,\"warning\":90}},{\"alias\":\"core 12 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":78,\"warning\":90}},{\"alias\":\"core 13 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":75,\"warning\":90}},{\"alias\":\"core 14 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":38,\"warning\":90}},{\"alias\":\"core 15 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":12,\"warning\":90}},{\"alias\":\"core 2 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":55,\"warning\":90}},{\"alias\":\"core 3 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":34,\"warning\":90}},{\"alias\":\"core 4 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":74,\"warning\":90}},{\"alias\":\"core 5 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":83,\"warning\":90}},{\"alias\":\"core 6 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":49,\"warning\":90}},{\"alias\":\"core 7 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":31,\"warning\":90}},{\"alias\":\"core 8 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":75,\"warning\":90}},{\"alias\":\"core 9 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":81,\"warning\":90}},{\"alias\":\"total 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":56,\"warning\":90}},{\"alias\":\"core 0 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":78,\"warning\":90}},{\"alias\":\"core 1 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":85,\"warning\":90}},{\"alias\":\"core 10 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":71,\"warning\":90}},{\"alias\":\"core 11 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":43,\"warning\":90}},{\"alias\":\"core 12 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":84,\"warning\":90}},{\"alias\":\"core 13 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":84,\"warning\":90}},{\"alias\":\"core 14 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":68,\"warning\":90}},{\"alias\":\"core 15 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":31,\"warning\":90}},{\"alias\":\"core 2 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":70,\"warning\":90}},{\"alias\":\"core 3 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":65,\"warning\":90}},{\"alias\":\"core 4 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":84,\"warning\":90}},{\"alias\":\"core 5 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":88,\"warning\":90}},{\"alias\":\"core 6 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":72,\"warning\":90}},{\"alias\":\"core 7 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":60,\"warning\":90}},{\"alias\":\"core 8 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":82,\"warning\":90}},{\"alias\":\"core 9 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":86,\"warning\":90}},{\"alias\":\"total 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":72,\"warning\":90}},{\"alias\":\"core 0 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":67,\"warning\":90}},{\"alias\":\"core 1 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":71,\"warning\":90}},{\"alias\":\"core 10 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":32,\"warning\":90}},{\"alias\":\"core 11 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":15,\"warning\":90}},{\"alias\":\"core 12 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":73,\"warning\":90}},{\"alias\":\"core 13 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":44,\"warning\":90}},{\"alias\":\"core 14 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":29,\"warning\":90}},{\"alias\":\"core 15 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":11,\"warning\":90}},{\"alias\":\"core 2 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":35,\"warning\":90}},{\"alias\":\"core 3 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":26,\"warning\":90}},{\"alias\":\"core 4 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":72,\"warning\":90}},{\"alias\":\"core 5 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":62,\"warning\":90}},{\"alias\":\"core 6 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":34,\"warning\":90}},{\"alias\":\"core 7 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":25,\"warning\":90}},{\"alias\":\"core 8 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":71,\"warning\":90}},{\"alias\":\"core 9 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":50,\"warning\":90}},{\"alias\":\"total 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":45,\"warning\":90}}]}],\"result\":\"OK\"}]}"
OK: CPU load is ok.|'core 0 5m'=72%;90;95;; 'core 1 5m'=79%;90;95;; 'core 10 5m'=42%;90;95;; 'core 11 5m'=18%;90;95;; 'core 12 5m'=78%;90;95;; 'core 13 5m'=75%;90;95;; 'core 14 5m'=38%;90;95;; 'core 15 5m'=12%;90;95;; 'core 2 5m'=55%;90;95;; 'core 3 5m'=34%;90;95;; 'core 4 5m'=74%;90;95;; 'core 5 5m'=83%;90;95;; 'core 6 5m'=49%;90;95;; 'core 7 5m'=31%;90;95;; 'core 8 5m'=75%;90;95;; 'core 9 5m'=81%;90;95;; 'total 5m'=56%;90;95;; 'core 0 15m'=78%;90;95;; 'core 1 15m'=85%;90;95;; 'core 10 15m'=71%;90;95;; 'core 11 15m'=43%;90;95;; 'core 12 15m'=84%;90;95;; 'core 13 15m'=84%;90;95;; 'core 14 15m'=68%;90;95;; 'core 15 15m'=31%;90;95;; 'core 2 15m'=70%;90;95;; 'core 3 15m'=65%;90;95;; 'core 4 15m'=84%;90;95;; 'core 5 15m'=88%;90;95;; 'core 6 15m'=72%;90;95;; 'core 7 15m'=60%;90;95;; 'core 8 15m'=82%;90;95;; 'core 9 15m'=86%;90;95;; 'total 15m'=72%;90;95;; 'core 0 60m'=67%;90;95;; 'core 1 60m'=71%;90;95;; 'core 10 60m'=32%;90;95;; 'core 11 60m'=15%;90;95;; 'core 12 60m'=73%;90;95;; 'core 13 60m'=44%;90;95;; 'core 14 60m'=29%;90;95;; 'core 15 60m'=11%;90;95;; 'core 2 60m'=35%;90;95;; 'core 3 60m'=26%;90;95;; 'core 4 60m'=72%;90;95;; 'core 5 60m'=62%;90;95;; 'core 6 60m'=34%;90;95;; 'core 7 60m'=25%;90;95;; 'core 8 60m'=71%;90;95;; 'core 9 60m'=50%;90;95;; 'total 60m'=45%;90;95;;
$ ./check_nsc_web -v -u http://1.2.3.52:8443 -p 012345678901 -t 30 check_cpu 'filter=none' 'time=5m' 'time=15m' 'time=60m' 'warning=load > 90' 'crit=load > 95'
REQUEST:
"GET /query/check_cpu?filter=none&time=5m&time=15m&time=60m&warning=load+%3E+90&crit=load+%3E+95 HTTP/1.1\r\nHost: 1.2.3.52:8443\r\nUser-Agent: Go-http-client/1.1\r\nPassword: 012345678901\r\nAccept-Encoding: gzip\r\n\r\n"
RESPONSE:
"HTTP/1.0 200 200\r\nConnection: close\r\nContent-Length: 2462\r\n\r\n{\"header\":{\"source_id\":\"\"},\"payload\":[{\"command\":\"check_cpu\",\"lines\":[{\"message\":\"WARNING: 5m: 94%, 15m: 91%, 60m: 91%\",\"perf\":[{\"alias\":\"core 0 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":32,\"warning\":90}},{\"alias\":\"core 1 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":42,\"warning\":90}},{\"alias\":\"core 2 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":59,\"warning\":90}},{\"alias\":\"core 3 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":46,\"warning\":90}},{\"alias\":\"core 4 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":94,\"warning\":90}},{\"alias\":\"core 5 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":48,\"warning\":90}},{\"alias\":\"core 6 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":61,\"warning\":90}},{\"alias\":\"core 7 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":86,\"warning\":90}},{\"alias\":\"total 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":58,\"warning\":90}},{\"alias\":\"core 0 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":32,\"warning\":90}},{\"alias\":\"core 1 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":44,\"warning\":90}},{\"alias\":\"core 2 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":79,\"warning\":90}},{\"alias\":\"core 3 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":50,\"warning\":90}},{\"alias\":\"core 4 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":91,\"warning\":90}},{\"alias\":\"core 5 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":54,\"warning\":90}},{\"alias\":\"core 6 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":82,\"warning\":90}},{\"alias\":\"core 7 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":64,\"warning\":90}},{\"alias\":\"total 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":62,\"warning\":90}},{\"alias\":\"core 0 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":19,\"warning\":90}},{\"alias\":\"core 1 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":31,\"warning\":90}},{\"alias\":\"core 2 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":40,\"warning\":90}},{\"alias\":\"core 3 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":32,\"warning\":90}},{\"alias\":\"core 4 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":47,\"warning\":90}},{\"alias\":\"core 5 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":42,\"warning\":90}},{\"alias\":\"core 6 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":91,\"warning\":90}},{\"alias\":\"core 7 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":45,\"warning\":90}},{\"alias\":\"total 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":43,\"warning\":90}}]}],\"result\":\"WARNING\"}]}"
WARNING: 5m: 94%, 15m: 91%, 60m: 91%|'core 0 5m'=32%;90;95;; 'core 1 5m'=42%;90;95;; 'core 2 5m'=59%;90;95;; 'core 3 5m'=46%;90;95;; 'core 4 5m'=94%;90;95;; 'core 5 5m'=48%;90;95;; 'core 6 5m'=61%;90;95;; 'core 7 5m'=86%;90;95;; 'total 5m'=58%;90;95;; 'core 0 15m'=32%;90;95;; 'core 1 15m'=44%;90;95;; 'core 2 15m'=79%;90;95;; 'core 3 15m'=50%;90;95;; 'core 4 15m'=91%;90;95;; 'core 5 15m'=54%;90;95;; 'core 6 15m'=82%;90;95;; 'core 7 15m'=64%;90;95;; 'total 15m'=62%;90;95;; 'core 0 60m'=19%;90;95;; 'core 1 60m'=31%;90;95;; 'core 2 60m'=40%;90;95;; 'core 3 60m'=32%;90;95;; 'core 4 60m'=47%;90;95;; 'core 5 60m'=42%;90;95;; 'core 6 60m'=91%;90;95;; 'core 7 60m'=45%;90;95;; 'total 60m'=43%;90;95;;
$ ./check_nsc_web -v -u http://1.2.3.53:8443 -p 012345678901 -t 30 check_cpu 'filter=none' 'time=5m' 'time=15m' 'time=60m' 'warning=load > 90' 'crit=load > 95'
REQUEST:
"GET /query/check_cpu?filter=none&time=5m&time=15m&time=60m&warning=load+%3E+90&crit=load+%3E+95 HTTP/1.1\r\nHost: 1.2.3.53:8443\r\nUser-Agent: Go-http-client/1.1\r\nPassword: 012345678901\r\nAccept-Encoding: gzip\r\n\r\n"
RESPONSE:
"HTTP/1.0 200 200\r\nConnection: close\r\nContent-Length: 2519\r\n\r\n{\"header\":{\"source_id\":\"\"},\"payload\":[{\"command\":\"check_cpu\",\"lines\":[{\"message\":\"CRITICAL: 5m: 95%, 5m: 94%, 5m: 98%, 15m: 94%, 15m: 94%, 15m: 98%, 60m: 94%, 60m: 94%, 60m: 97%\",\"perf\":[{\"alias\":\"core 0 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":66,\"warning\":90}},{\"alias\":\"core 1 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":87,\"warning\":90}},{\"alias\":\"core 2 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":95,\"warning\":90}},{\"alias\":\"core 3 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":94,\"warning\":90}},{\"alias\":\"core 4 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":98,\"warning\":90}},{\"alias\":\"core 5 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":65,\"warning\":90}},{\"alias\":\"core 6 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":31,\"warning\":90}},{\"alias\":\"core 7 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":4,\"warning\":90}},{\"alias\":\"total 5m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":68,\"warning\":90}},{\"alias\":\"core 0 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":68,\"warning\":90}},{\"alias\":\"core 1 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":87,\"warning\":90}},{\"alias\":\"core 2 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":94,\"warning\":90}},{\"alias\":\"core 3 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":94,\"warning\":90}},{\"alias\":\"core 4 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":98,\"warning\":90}},{\"alias\":\"core 5 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":64,\"warning\":90}},{\"alias\":\"core 6 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":32,\"warning\":90}},{\"alias\":\"core 7 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":5,\"warning\":90}},{\"alias\":\"total 15m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":68,\"warning\":90}},{\"alias\":\"core 0 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":67,\"warning\":90}},{\"alias\":\"core 1 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":89,\"warning\":90}},{\"alias\":\"core 2 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":94,\"warning\":90}},{\"alias\":\"core 3 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":94,\"warning\":90}},{\"alias\":\"core 4 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":97,\"warning\":90}},{\"alias\":\"core 5 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":63,\"warning\":90}},{\"alias\":\"core 6 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":31,\"warning\":90}},{\"alias\":\"core 7 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":4,\"warning\":90}},{\"alias\":\"total 60m\",\"int_value\":{\"critical\":95,\"unit\":\"%\",\"value\":67,\"warning\":90}}]}],\"result\":\"CRITICAL\"}]}"
CRITICAL: 5m: 95%, 5m: 94%, 5m: 98%, 15m: 94%, 15m: 94%, 15m: 98%, 60m: 94%, 60m: 94%, 60m: 97%|'core 0 5m'=66%;90;95;; 'core 1 5m'=87%;90;95;; 'core 2 5m'=95%;90;95;; 'core 3 5m'=94%;90;95;; 'core 4 5m'=98%;90;95;; 'core 5 5m'=65%;90;95;; 'core 6 5m'=31%;90;95;; 'core 7 5m'=4%;90;95;; 'total 5m'=68%;90;95;; 'core 0 15m'=68%;90;95;; 'core 1 15m'=87%;90;95;; 'core 2 15m'=94%;90;95;; 'core 3 15m'=94%;90;95;; 'core 4 15m'=98%;90;95;; 'core 5 15m'=64%;90;95;; 'core 6 15m'=32%;90;95;; 'core 7 15m'=5%;90;95;; 'total 15m'=68%;90;95;; 'core 0 60m'=67%;90;95;; 'core 1 60m'=89%;90;95;; 'core 2 60m'=94%;90;95;; 'core 3 60m'=94%;90;95;; 'core 4 60m'=97%;90;95;; 'core 5 60m'=63%;90;95;; 'core 6 60m'=31%;90;95;; 'core 7 60m'=4%;90;95;; 'total 60m'=67%;90;95;;