V1rus Private
User / IP
:
216.73.217.108
Host / Server
:
190.92.174.125 / aerosofthealthcare.com
System
:
Linux s3739.bom1.stableserver.net 4.18.0-513.24.1.lve.2.el8.x86_64 #1 SMP Fri May 24 12:42:50 UTC 2024 x86_64
Cmd
|
Upload
|
Mass Deface
|
Create
|
Sym
:
/
lib64
/
nagios
/
plugins
/
Viewing: check_a2_saltmaster_api.sh
#!/bin/bash # Initialize variables exit_code=0 output="" # Check salt-master status salt_master_status=$(systemctl is-active salt-master 2>/dev/null) salt_master_ports_status=$(netstat -lntu | grep -E -c ":(4505|4506).*LISTEN") if [ "$salt_master_status" != "active" ]; then output+="check_saltmaster_status - Saltmaster is not running. " exit_code=2 fi if [ "$salt_master_ports_status" -ne 2 ]; then output+="check_saltmaster_ports_status - Ports 4505/4506 are not listening. " exit_code=2 fi # Check salt-api status salt_api_status=$(systemctl is-active salt-api 2>/dev/null) salt_api_ports_status=$(netstat -lntu | grep -E -c ":8000.*LISTEN") if [ "$salt_api_status" != "active" ]; then output+="check_salt-api_status - Salt-api is not running. " exit_code=2 fi if [ "$salt_api_ports_status" -ne 1 ]; then output+="check_salt-api_port_status - Port 8000 is not listening. " exit_code=2 fi # If everything is fine if [ "$exit_code" -eq 0 ]; then output="OK - Saltmaster and Salt-api services are running with correct ports open." fi # Print final output and exit with the highest severity found echo "$output" exit $exit_code
Coded With 💗 by
HanzOFC