computer_glamour 1 vecka sedan
incheckning
54bc74fa55
5 ändrade filer med 65 tillägg och 0 borttagningar
  1. 27 0
      README.md
  2. 38 0
      check.sh
  3. BIN
      fmonitor.so
  4. BIN
      gkrellmlaunch.so
  5. BIN
      multiping.so

+ 27 - 0
README.md

@@ -0,0 +1,27 @@
+# My GKrellM setup
+
+I migrated from linux mint desklets to GKrellM i needed to use some plugins and write custom script and so i wanted to save it somewhere so i wont lose it
+
+This repo contains:
+
+- fmonitor.so source: https://github.com/jmakovicka/gkrellm-fmonitor
+
+  - file monitor plugin a simple plugin that can show output of a command or contents of a file as a KEY:VALUE:ALERT array and display it in GKrellM
+  - I am using for monitoring SSL certs on websites i host or manage
+
+- gkrellmlauncch.so source: https://gkrellmlaunch.sourceforge.net/
+
+  - simple plugin that allows to make buttons to exexute commands
+  - I am using for turning ON and OFF my VPN connections launch SSH tunnels and sessions and also running some programs that need root privileges 
+
+- multiping.so source: https://github.com/jmakovicka/gkrellm-multiping
+
+  - simple plugin that allows pings to multiple IP addresses
+  - i use it to monitor currently connected devices to my VPN
+
+- check.sh
+
+  - simple script that in conjunction with fmonitor plugin displays monitored domains nicely in std out
+  - you need to add it to fmonitor plugin as `| /path/to/script/check.sh`
+
+  In order to use the plugins you need to copy them to `~/user/.gkrellm2/plugins` they are precomplied so you dont need to compile them yourself

+ 38 - 0
check.sh

@@ -0,0 +1,38 @@
+#!/bin/bash
+
+DOMAINS=(
+    "glamour.ovh"
+    "expired.badssl.com"
+)
+
+NAMES=(
+    "GLAM"
+    "BAD"
+)
+
+check_domain() {
+    local domain="$1"
+    local name="$2"
+    local url="https://${domain}"
+    local status="FAIL"
+    
+    http_code=$(curl -s -o /dev/null -w "%{http_code}" --max-time 10 --head "$url")
+    curl_exit=$?
+
+    if [ $curl_exit -eq 0 ] && [ "$http_code" -ge 200 ] && [ "$http_code" -lt 400 ]; then
+        status="OK"
+    else
+        status="NOK:ALERT"
+    fi
+
+    echo "${name}: ${status}"
+}
+
+if [ "${#DOMAINS[@]}" -ne "${#NAMES[@]}" ]; then
+    echo "Error: Domain and Name array lengths do not match."
+    exit 1
+fi
+
+for i in "${!DOMAINS[@]}"; do
+    check_domain "${DOMAINS[$i]}" "${NAMES[$i]}"
+done

BIN
fmonitor.so


BIN
gkrellmlaunch.so


BIN
multiping.so