Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marcus Klang
Host Monitor
Commits
ee0a4d32
Commit
ee0a4d32
authored
Jun 07, 2021
by
Peter Möller
Browse files
Update host-monitor.sh
parent
21b5f32c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Synology/host-monitor.sh
View file @
ee0a4d32
...
...
@@ -56,6 +56,7 @@ VMenv=""
# Get more platform data
PlatformManufacturer
=
"
$(
/sbin/dmidecode
-t
2 2>/dev/null | egrep
"^
\s
*Manufacturer:"
|
cut
-d
:
-f2
|
cut
-c2-
)
"
# Ex: PlatformManufacturer='Type2 - Board Vendor Name1'
PlatformType
=
"
$(
/sbin/dmidecode
-t
2 2>/dev/null | egrep
"^
\s
*Type:"
|
cut
-d
:
-f2
|
cut
-c2-
)
"
# Ex: PlatformType=Motherboard
Platform
=
"
$(
egrep upnpmodelname /etc/synoinfo.conf |
cut
-d
\"
-f2
)
"
# Network interfaces
IFs
=
$(
/sbin/ip a |awk
'/state UP/{print $2}'
|
sed
's/://'
)
...
...
@@ -119,11 +120,8 @@ NIStr="\"network-interfaces\": [ $(echo "${OUTPUT}" | sed 's/,$//') ]"
# Ex: NIStr='"network-interfaces": [ { "interface": "ens192", "ip4": "130.235.16.11/23", "ip6": "fe80::250:56ff:feb6:b194/64", "mac": "00:50:56:b6:b1:94", "mac-p": "00:50:56:b6:b1:94", "speed": "10000Mb/s" } ]'
# Platform
if
[
-n
"
$VMenv
"
]
;
then
PlatformStr
=
"
\"
platform
\"
: {
\"
virtualized
\"
: true,
\"
name
\"
:
\"
$VMenv
\"
}"
else
PlatformStr
=
"
\"
platform
\"
: {
\"
virtualized
\"
: false,
\"
name
\"
:
\"
type:
$PlatformType
\"
}"
fi
PlatformStr
=
"
\"
platform
\"
: {
\"
virtualized
\"
: false,
\"
name
\"
:
\"
Model:
$Platform
\"
}"
# network
AliasName
=
",
\"
alias
\"
: [
\"
$DNSAlias
\"
] "
NetworkStr
=
"
\"
network
\"
: {
\"
hostname
\"
:
\"
$(
hostname
-f
)
\"
$AliasName
}"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment