tomcat: check if user exist before checking its Tomcat instance
This commit is contained in:
parent
39a58c3d53
commit
eb54157271
2 changed files with 5 additions and 0 deletions
|
@ -17,6 +17,8 @@ The **patch** part is incremented if multiple releases happen the same month
|
|||
|
||||
### Fixed
|
||||
|
||||
* tomcat: check if user exist before checking its Tomcat instance.
|
||||
|
||||
### Removed
|
||||
|
||||
### Security
|
||||
|
|
|
@ -13,6 +13,9 @@ output=""
|
|||
|
||||
instances=$(ls "${TOMCAT_ROOT}")
|
||||
for instance in ${instances}; do
|
||||
if ! id -u "${instance}" 2> /dev/null; then
|
||||
continue
|
||||
fi
|
||||
port=$(id -u "${instance}")
|
||||
if [ -h "${TOMCAT_ROOT}/${instance}/.config/systemd/user/default.target.wants/tomcat.service" ]; then
|
||||
/usr/lib/nagios/plugins/check_tcp -p "${port}" >/dev/null 2>&1
|
||||
|
|
Loading…
Add table
Reference in a new issue