-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathosinfo
executable file
·38 lines (31 loc) · 1.02 KB
/
osinfo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# (c) Harald Weidner, 2019-02-15
# License: MIT
#
# Checkmk local check
# displays some hardware/OS/kernel information in the monitoring console
#
# example output:
#
# 0 Uname - Linux darkstar 4.15.0-45-generic #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
# 0 LSB_Release - Ubuntu 18.04.2 LTS
# 0 Hostname_IPs - darkstar // 192.168.1.2
# 0 Kernel_Cmdline - BOOT_IMAGE=/vmlinuz-4.15.0-45-generic root=/dev/mapper/system-ubuntu ro nvidia-drm.modeset=1
if type uname >/dev/null 2>&1 ; then
echo "0 Uname - $(uname -a)"
fi
if type lsb_release >/dev/null 2>&1 ; then
echo "0 \"LSB Release\" - $(lsb_release -ds)"
fi
if type hostname >/dev/null 2>&1 ; then
echo "0 \"Hostname and IPs\" - $(hostname -f) // $(hostname -I)"
fi
if [[ -f /proc/cmdline ]]; then
echo "0 \"Kernel Cmdline\" - $(cat /proc/cmdline)"
fi
if type virt-what >/dev/null 2>&1 ; then
virt=$(virt-what | tr '\n' ' ')
if [[ -n "$virt" ]]; then
echo "0 Hypervisor - Hypervisor(s): $virt(guessed by virt-what)"
fi
fi