Skip to content

Commit

Permalink
add tools package
Browse files Browse the repository at this point in the history
  • Loading branch information
NimVek committed Nov 5, 2022
1 parent 1f986ab commit dee1361
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tools/bin/randomize_long_intervals.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash -x

set -o errexit
set -o nounset

INTERVAL_LENGTH=$(lq "GET status\nColumns: interval_length")

lq "GET services\nColumns: host_name description check_interval\nFilter: check_interval >= 60" | while IFS=';' read host service interval ; do
INTERVAL=$(( ${interval} * ${INTERVAL_LENGTH} ))
NEXT=$(shuf -i 1-${INTERVAL} -n 1)
NOW=$(date +%s)
THEN=$(( ${NOW} + ${NEXT} ))
echo "COMMAND [${NOW}] SCHEDULE_FORCED_SVC_CHECK;${host};${service};${THEN}" | lq
done
17 changes: 17 additions & 0 deletions tools/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"author": "NimVek <NimVek@users.noreply.github.com>",
"description": "",
"download_url": "https://github.com/NimVek/checkmk-packages/tree/main/tools",
"files": {
"bin": [
"randomize_long_intervals.sh"
]
},
"name": "tools",
"num_files": 1,
"title": "Bash Tools",
"version": "1.0.0",
"version.min_required": "2.0.0p23",
"version.packaged": "2.0.0p23",
"version.usable_until": null
}
Binary file added tools/tools-1.0.0.mkp
Binary file not shown.

0 comments on commit dee1361

Please sign in to comment.