summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormischa <mischa@rx.high5.nl>2021-01-03 13:52:23 +0100
committermischa <mischa@rx.high5.nl>2021-01-03 13:52:23 +0100
commit9d3c8a72b3d25874527748426f103d671d78e5ce (patch)
tree3d780a8ca3170583c1cc491de9f841aa2fe3993c
parent39fdfd90afd997f11138e04a5d5f5703d296c298 (diff)
adding helper scripts for load and ipinfo
-rwxr-xr-xipinfo.sh21
-rwxr-xr-xload.sh21
2 files changed, 42 insertions, 0 deletions
diff --git a/ipinfo.sh b/ipinfo.sh
new file mode 100755
index 0000000..9e04033
--- /dev/null
+++ b/ipinfo.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+#
+# Copyright (c) 2019-2020 Mischa Peters <mischa @ openbsd.amsterdam>
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+OUT=$(grep -B2 -A1 ${1} /etc/dhcpd.conf)
+if [ "$OUT" ]; then
+ echo $(hostname)
+ echo ${OUT}
+fi
diff --git a/load.sh b/load.sh
new file mode 100755
index 0000000..055aeca
--- /dev/null
+++ b/load.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+#
+# Copyright (c) 2019-2020 Mischa Peters <mischa @ openbsd.amsterdam>
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+OUT=$(ps -uU _vmd | awk '$3 > 45.0 {print $12, $3"%"}')
+if [ "$OUT" ]; then
+ echo $(hostname)
+ echo ${OUT}
+fi