Univention Bugzilla – Bug 31374
Monitor Samba 4 using Nagios
Last modified: 2022-06-27 17:48:19 CEST
It would be good if Samba 4 would be monitored using Nagios. Both whether the Samba 4 server is running as well as if the drs replication is working without any problems.
I wrote a very simple check: #!/bin/bash # check the replication of samba4 # by thomas manninger, siedl networks gmbh errors=$(samba-tool drs showrepl 2> /dev/null | grep "consecutive failure(s)" | sed -e "s/\t//g" | grep -v "^0" | wc -l) if [ $errors -gt 0 ]; then echo "CRITICAL: $errors replication links fails!"; exit fi echo "OK" It works as long as the text output dont change with a samba4 update :)
Thats the correct version: #!/bin/bash # check the replication of samba4 # by thomas manninger, siedl networks gmbh errors=$(samba-tool drs showrepl 2> /dev/null | grep "consecutive failure(s)" | sed -e "s/\t//g" | grep -v "^0" | wc -l) if [ $errors -gt 0 ]; then echo "CRITICAL: $errors replication links fails!"; exit 2 fi echo "OK" exit 0
Some check for running daemons could include: * Comparing $(samba-tool processes) vs $(pgrep -f /usr/sbin/samba) * Checks for essential ports (88, 135, 389, 445, 464, 636, 3268, 3269)
* s4 connector rejects
This issue has been filed against UCS 4.2. UCS 4.2 is out of maintenance and many UCS components have changed in later releases. Thus, this issue is now being closed. If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen it and update the UCS version. In this case please provide detailed information on how this issue is affecting you.