Skip to content

Instantly share code, notes, and snippets.

@kmuto
kmuto / deferclose.sh
Last active March 31, 2024 13:23
遅延アラートクローズスクリプト
#!/bin/bash
CLOSE_AFTER_MINUTES="60"
CLOSE_CHECK_ONLY=true
DRYRUN=
if [ -z "$(mkr --version 2>/dev/null)" ]; then
echo "ERROR: Missing mkr. Install mkr package."
exit 1
fi
if [ ! -f "/etc/mackerel-agent/mackerel-agent.conf" -a -z "$MACKEREL_APIKEY" ]; then
@kmuto
kmuto / last-service-post.sh
Created April 15, 2024 23:24
各サービスメトリック投稿の最終投稿日をまとめて調べる
#!/bin/bash
# Display of the last posting date of the service metric
# 2024 Kenshi Muto
services=$(mkr services -jq '.[]|.name')
echo "$services" | while read service; do
metrics=$(mkr metric-names -s $service -jq '.[]')
echo "$metrics" | while read metric; do
if [ -z "$metric" ]; then
continue
fi