Update doc/instructions.

Update example dashboards.
Add more processes to default list.
This commit is contained in:
Mark Nellemann 2022-09-19 14:15:48 +02:00
parent dd475c6d23
commit ba0313f84a
6 changed files with 95 additions and 60 deletions

View file

@ -28,7 +28,7 @@ get_pid() {
} }
is_running() { is_running() {
[ -f "$pid_file" ] && ps -p `get_pid` > /dev/null 2>&1 [ -f "$pid_file" ] && ps -p $(get_pid) > /dev/null 2>&1
} }
case "$1" in case "$1" in
@ -37,7 +37,7 @@ case "$1" in
echo "Already started" echo "Already started"
else else
echo "Starting $name" echo "Starting $name"
cd "$dir" cd "$dir" || exit 1
if [ -z "$user" ]; then if [ -z "$user" ]; then
$cmd $args >> "$stdout_log" 2>> "$stderr_log" & $cmd $args >> "$stdout_log" 2>> "$stderr_log" &
else else
@ -52,16 +52,14 @@ case "$1" in
;; ;;
stop) stop)
if is_running; then if is_running; then
echo -n "Stopping $name.." echo "Stopping $name.."
kill `get_pid` kill $(get_pid)
for i in 1 2 3 4 5 6 7 8 9 10 for i in 1 2 3 4 5 6 7 8 9 10
# for i in `seq 10` # for i in `seq 10`
do do
if ! is_running; then if ! is_running; then
break break
fi fi
echo -n "."
sleep 1 sleep 1
done done
echo echo

View file

@ -18,6 +18,9 @@ exclude_mount = [ "/boot/efi" ]
[extension.base_process] [extension.base_process]
enabled = true enabled = true
include = [ "java", "mysqld", "postgres", "influxd" ] include = [
"java", "node", "httpd", "mongod", "mysqld",
"postgres", "influxd", "haproxy", "beam.smp",
"filebeat", "corosync", "rsyslogd", "memcached",
"db2sysc", "dsmserv", "mmfsd",
]

View file

@ -1,13 +1,5 @@
{ {
"__inputs": [ "__inputs": [
{
"name": "DS_INFLUXDB-HMCI",
"label": "InfluxDB-hmci",
"description": "",
"type": "datasource",
"pluginId": "influxdb",
"pluginName": "InfluxDB"
},
{ {
"name": "DS_INFLUXDB-SYSMON", "name": "DS_INFLUXDB-SYSMON",
"label": "InfluxDB-sysmon", "label": "InfluxDB-sysmon",
@ -95,7 +87,7 @@
{ {
"datasource": { "datasource": {
"type": "influxdb", "type": "influxdb",
"uid": "${DS_INFLUXDB-HMCI}" "uid": "${DS_INFLUXDB-SYSMON}"
}, },
"gridPos": { "gridPos": {
"h": 3, "h": 3,
@ -113,7 +105,7 @@
{ {
"datasource": { "datasource": {
"type": "influxdb", "type": "influxdb",
"uid": "${DS_INFLUXDB-HMCI}" "uid": "${DS_INFLUXDB-SYSMON}"
}, },
"refId": "A" "refId": "A"
} }
@ -174,7 +166,7 @@
"overrides": [] "overrides": []
}, },
"gridPos": { "gridPos": {
"h": 4, "h": 5,
"w": 24, "w": 24,
"x": 0, "x": 0,
"y": 4 "y": 4
@ -225,7 +217,7 @@
"measurement": "base_info", "measurement": "base_info",
"orderByTime": "DESC", "orderByTime": "DESC",
"policy": "default", "policy": "default",
"query": "SELECT last(\"os_manufacturer\") AS \"manufacturer\", last(\"os_family\") AS \"family\", last(\"os_version\") AS \"version\", last(\"os_codename\") AS \"codename\", last(\"os_build\") AS \"build\", last(\"boot_time\") * 1000 AS \"boottime\" FROM \"base_info\" WHERE (\"hostname\" =~ /^$hostname$/) AND $timeFilter GROUP BY time($__interval), \"hostname\" fill(null) ORDER BY time DESC LIMIT 1000", "query": "SELECT last(\"os_manufacturer\") AS \"manufacturer\", last(\"os_family\") AS \"family\", last(\"os_version\") AS \"version\", last(\"os_codename\") AS \"codename\", last(\"os_build\") AS \"build\", last(\"boot_time\") * 1000 AS \"boottime\" FROM \"base_info\" WHERE (\"hostname\" =~ /^$hostname$/) AND $timeFilter GROUP BY time($__interval), \"hostname\" fill(previous) ORDER BY time DESC LIMIT 1000",
"rawQuery": true, "rawQuery": true,
"refId": "A", "refId": "A",
"resultFormat": "table", "resultFormat": "table",
@ -385,6 +377,10 @@
{ {
"destinationType": "time", "destinationType": "time",
"targetField": "Boot Time" "targetField": "Boot Time"
},
{
"destinationType": "string",
"targetField": "OS Version"
} }
], ],
"fields": {} "fields": {}
@ -409,7 +405,7 @@
"h": 5, "h": 5,
"w": 12, "w": 12,
"x": 0, "x": 0,
"y": 8 "y": 9
}, },
"hiddenSeries": false, "hiddenSeries": false,
"id": 2, "id": 2,
@ -679,7 +675,7 @@
"h": 5, "h": 5,
"w": 12, "w": 12,
"x": 12, "x": 12,
"y": 8 "y": 9
}, },
"id": 16, "id": 16,
"options": { "options": {
@ -860,7 +856,7 @@
"h": 6, "h": 6,
"w": 12, "w": 12,
"x": 0, "x": 0,
"y": 13 "y": 14
}, },
"hiddenSeries": false, "hiddenSeries": false,
"id": 29, "id": 29,
@ -1162,7 +1158,7 @@
"h": 6, "h": 6,
"w": 4, "w": 4,
"x": 12, "x": 12,
"y": 13 "y": 14
}, },
"id": 19, "id": 19,
"options": { "options": {
@ -1336,7 +1332,7 @@
"h": 6, "h": 6,
"w": 8, "w": 8,
"x": 16, "x": 16,
"y": 13 "y": 14
}, },
"id": 17, "id": 17,
"options": { "options": {
@ -1509,7 +1505,7 @@
"h": 9, "h": 9,
"w": 12, "w": 12,
"x": 0, "x": 0,
"y": 19 "y": 20
}, },
"id": 10, "id": 10,
"options": { "options": {
@ -1666,7 +1662,7 @@
"h": 9, "h": 9,
"w": 12, "w": 12,
"x": 12, "x": 12,
"y": 19 "y": 20
}, },
"id": 30, "id": 30,
"options": { "options": {
@ -1824,7 +1820,7 @@
"h": 9, "h": 9,
"w": 12, "w": 12,
"x": 0, "x": 0,
"y": 28 "y": 29
}, },
"id": 31, "id": 31,
"options": { "options": {
@ -1970,7 +1966,7 @@
"h": 9, "h": 9,
"w": 12, "w": 12,
"x": 12, "x": 12,
"y": 28 "y": 29
}, },
"id": 18, "id": 18,
"options": { "options": {
@ -2082,7 +2078,7 @@
"h": 10, "h": 10,
"w": 12, "w": 12,
"x": 0, "x": 0,
"y": 37 "y": 38
}, },
"hiddenSeries": false, "hiddenSeries": false,
"id": 24, "id": 24,
@ -2261,8 +2257,7 @@
"mode": "absolute", "mode": "absolute",
"steps": [ "steps": [
{ {
"color": "green", "color": "green"
"value": null
} }
] ]
}, },
@ -2274,7 +2269,7 @@
"h": 10, "h": 10,
"w": 12, "w": 12,
"x": 12, "x": 12,
"y": 37 "y": 38
}, },
"id": 25, "id": 25,
"options": { "options": {
@ -2399,8 +2394,7 @@
"mode": "absolute", "mode": "absolute",
"steps": [ "steps": [
{ {
"color": "green", "color": "green"
"value": null
}, },
{ {
"color": "red", "color": "red",
@ -2416,7 +2410,7 @@
"h": 9, "h": 9,
"w": 12, "w": 12,
"x": 0, "x": 0,
"y": 47 "y": 48
}, },
"id": 8, "id": 8,
"options": { "options": {
@ -2589,8 +2583,7 @@
"mode": "absolute", "mode": "absolute",
"steps": [ "steps": [
{ {
"color": "transparent", "color": "transparent"
"value": null
}, },
{ {
"color": "orange", "color": "orange",
@ -2610,7 +2603,7 @@
"h": 9, "h": 9,
"w": 12, "w": 12,
"x": 12, "x": 12,
"y": 47 "y": 48
}, },
"id": 26, "id": 26,
"options": { "options": {
@ -2728,8 +2721,7 @@
"mode": "absolute", "mode": "absolute",
"steps": [ "steps": [
{ {
"color": "green", "color": "green"
"value": null
} }
] ]
}, },
@ -2838,7 +2830,7 @@
"h": 6, "h": 6,
"w": 24, "w": 24,
"x": 0, "x": 0,
"y": 56 "y": 57
}, },
"id": 22, "id": 22,
"options": { "options": {
@ -3094,6 +3086,6 @@
"timezone": "", "timezone": "",
"title": "Sysmon Agent - Host Overview", "title": "Sysmon Agent - Host Overview",
"uid": "QkVPjseMk", "uid": "QkVPjseMk",
"version": 29, "version": 30,
"weekStart": "" "weekStart": ""
} }

View file

@ -9,13 +9,13 @@
"pluginName": "InfluxDB" "pluginName": "InfluxDB"
} }
], ],
"__elements": [], "__elements": {},
"__requires": [ "__requires": [
{ {
"type": "grafana", "type": "grafana",
"id": "grafana", "id": "grafana",
"name": "Grafana", "name": "Grafana",
"version": "8.4.7" "version": "9.0.7"
}, },
{ {
"type": "datasource", "type": "datasource",
@ -52,7 +52,10 @@
"list": [ "list": [
{ {
"builtIn": 1, "builtIn": 1,
"datasource": "-- Grafana --", "datasource": {
"type": "datasource",
"uid": "grafana"
},
"enable": true, "enable": true,
"hide": true, "hide": true,
"iconColor": "rgba(0, 211, 255, 1)", "iconColor": "rgba(0, 211, 255, 1)",
@ -72,11 +75,14 @@
"fiscalYearStartMonth": 0, "fiscalYearStartMonth": 0,
"graphTooltip": 0, "graphTooltip": 0,
"id": null, "id": null,
"iteration": 1657627348578,
"links": [], "links": [],
"liveNow": false, "liveNow": false,
"panels": [ "panels": [
{ {
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB-SYSMON}"
},
"gridPos": { "gridPos": {
"h": 3, "h": 3,
"w": 24, "w": 24,
@ -88,12 +94,25 @@
"content": "## Metrics are collected by an agent running inside of each LPAR / VM / Host.\n \n For more information: [bitbucket.org/mnellemann/sysmon](https://bitbucket.org/mnellemann/sysmon)\n ", "content": "## Metrics are collected by an agent running inside of each LPAR / VM / Host.\n \n For more information: [bitbucket.org/mnellemann/sysmon](https://bitbucket.org/mnellemann/sysmon)\n ",
"mode": "markdown" "mode": "markdown"
}, },
"pluginVersion": "8.4.7", "pluginVersion": "9.0.7",
"targets": [
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB-SYSMON}"
},
"refId": "A"
}
],
"transparent": true, "transparent": true,
"type": "text" "type": "text"
}, },
{ {
"collapsed": false, "collapsed": false,
"datasource": {
"type": "influxdb",
"uid": "5KYZifB7z"
},
"gridPos": { "gridPos": {
"h": 1, "h": 1,
"w": 24, "w": 24,
@ -103,6 +122,15 @@
"id": 4, "id": 4,
"panels": [], "panels": [],
"repeat": "hostname", "repeat": "hostname",
"targets": [
{
"datasource": {
"type": "influxdb",
"uid": "5KYZifB7z"
},
"refId": "A"
}
],
"title": "${hostname}", "title": "${hostname}",
"type": "row" "type": "row"
}, },
@ -119,7 +147,8 @@
}, },
"custom": { "custom": {
"align": "left", "align": "left",
"displayMode": "auto" "displayMode": "auto",
"inspect": false
}, },
"mappings": [], "mappings": [],
"thresholds": { "thresholds": {
@ -153,9 +182,13 @@
"showHeader": true, "showHeader": true,
"sortBy": [] "sortBy": []
}, },
"pluginVersion": "8.4.7", "pluginVersion": "9.0.7",
"targets": [ "targets": [
{ {
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB-SYSMON}"
},
"groupBy": [ "groupBy": [
{ {
"params": [ "params": [
@ -320,7 +353,7 @@
"text": {}, "text": {},
"textMode": "auto" "textMode": "auto"
}, },
"pluginVersion": "8.4.7", "pluginVersion": "9.0.7",
"targets": [ "targets": [
{ {
"datasource": { "datasource": {
@ -479,7 +512,7 @@
"text": {}, "text": {},
"textMode": "auto" "textMode": "auto"
}, },
"pluginVersion": "8.4.7", "pluginVersion": "9.0.7",
"targets": [ "targets": [
{ {
"datasource": { "datasource": {
@ -642,6 +675,10 @@
"targets": [ "targets": [
{ {
"alias": "$col", "alias": "$col",
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB-SYSMON}"
},
"groupBy": [ "groupBy": [
{ {
"params": [ "params": [
@ -821,6 +858,10 @@
"targets": [ "targets": [
{ {
"alias": "$col", "alias": "$col",
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB-SYSMON}"
},
"groupBy": [ "groupBy": [
{ {
"params": [ "params": [
@ -912,7 +953,7 @@
} }
], ],
"refresh": "1m", "refresh": "1m",
"schemaVersion": 35, "schemaVersion": 36,
"style": "dark", "style": "dark",
"tags": [], "tags": [],
"templating": { "templating": {

View file

@ -38,6 +38,9 @@ public class BaseProcessExtension implements MetricExtension {
add("rsyslogd"); add("rsyslogd");
add("postgres"); add("postgres");
add("memcached"); add("memcached");
add("db2sysc");
add("dsmserv");
add("mmfsd");
}}; }};
private final long minUptimeInSeconds = 300; private final long minUptimeInSeconds = 300;

View file

@ -28,7 +28,7 @@ get_pid() {
} }
is_running() { is_running() {
[ -f "$pid_file" ] && ps -p `get_pid` > /dev/null 2>&1 [ -f "$pid_file" ] && ps -p $(get_pid) > /dev/null 2>&1
} }
case "$1" in case "$1" in
@ -37,7 +37,7 @@ case "$1" in
echo "Already started" echo "Already started"
else else
echo "Starting $name" echo "Starting $name"
cd "$dir" cd "$dir" || exit 1
if [ -z "$user" ]; then if [ -z "$user" ]; then
$cmd $args >> "$stdout_log" 2>> "$stderr_log" & $cmd $args >> "$stdout_log" 2>> "$stderr_log" &
else else
@ -52,16 +52,14 @@ case "$1" in
;; ;;
stop) stop)
if is_running; then if is_running; then
echo -n "Stopping $name.." echo "Stopping $name.."
kill `get_pid` kill $(get_pid)
for i in 1 2 3 4 5 6 7 8 9 10 for i in 1 2 3 4 5 6 7 8 9 10
# for i in `seq 10` # for i in `seq 10`
do do
if ! is_running; then if ! is_running; then
break break
fi fi
echo -n "."
sleep 1 sleep 1
done done
echo echo