Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Scripts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Swen Brueseke
Scripts
Commits
1d78d226
Commit
1d78d226
authored
Aug 20, 2019
by
w.verleger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new file
parent
14f423b9
Pipeline
#51
failed with stages
in 27 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
0 deletions
+61
-0
XenServer/check/check_xslocks
XenServer/check/check_xslocks
+61
-0
No files found.
XenServer/check/check_xslocks
0 → 100644
View file @
1d78d226
#!/bin/bash
#
# File name : check_xslocks
#
# Created by : Wilken Verleger <info@proio.com>
# Created date : 20.08.2019
# Version : 1.0
# Licence : GPL - http://www.fsf.org/licenses/gpl.txt
#
# Information : Checks index page of XenServer for string set by check_xslocaldisk
#
# How to use : ./check_xslocks <hostname/ip>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
####################################################################
XSHOST
=
${
1
}
# check if wget is installed and save path
if
[
-z
$(
which wget
)
]
then
echo
"UNKNOWN - wget missing on system"
exit
3
else
wget
=
$(
which wget
)
fi
# check if XSHOST is empty
if
[[
-z
${
XSHOST
}
]]
then
echo
"UNKNOWN - no host to check against given. Usage ./check_xsdisk <hostname/ip>"
exit
3
else
MSG
=
$(
${
wget
}
-q
-O
-
${
XSHOST
}
|
grep
locks |
awk
-v
FS
=
"(<locks> |</locks>)"
'{print $2}'
)
ALERTSTATUS
=
$(
${
wget
}
-q
-O
-
${
XSHOST
}
|
grep
locks |
awk
'{print $2}'
)
if
[[
$ALERTSTATUS
==
"OK"
]]
then
echo
"
$MSG
"
exit
0
elif
[[
$ALERTSTATUS
==
"WARNING"
]]
then
echo
"
$MSG
"
exit
1
elif
[[
$ALERTSTATUS
==
"CRITICAL"
]]
then
echo
"
$MSG
"
exit
2
else
echo
"UNKNOWN - did check script run once on xenserver?"
exit
3
fi
fi
\ No newline at end of file
Write
Preview
Markdown
is supported
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