Watchdog doesn't work properly.

Srdjan

New Member
Hello Support,

We've been trying to setup watchdog but without success. We are using version 5.2.
What have tested watchdog_mail_script.sh and its working fine with our postfix but when we try to run watchdog_event_hook.sh manually we are getting errors below :
----------------------------------------------------------------------------(
[root@magija bin]# ./watchdog_event_hook.sh 36804 EventScannerDown /usr/local/FlashphonerWebCallServer
Params: PID: 36804 EVENT: EventScannerDown APPHOME: /usr/local/FlashphonerWebCallServer
REPORT_DIR: /usr/local/FlashphonerWebCallServer/logs/watchdog/report-19-10-24-21_28_40
mkdir: cannot create directory ‘/usr/local/FlashphonerWebCallServer/logs/watchdog/report-19-10-24-21_28_40’: No such file or directory
./watchdog_event_hook.sh: line 17: cd: /usr/local/FlashphonerWebCallServer/logs/watchdog/report-19-10-24-21_28_40: No such file or directory
mkdir: cannot create directory ‘logs_snapshot’: File exists
cp: cannot stat ‘/usr/local/FlashphonerWebCallServer/logs/flashphoner_manager.log’: No such file or directory
cp: cannot stat ‘/usr/local/FlashphonerWebCallServer/logs/gc-core.log’: No such file or directory
cp: cannot stat ‘/usr/local/FlashphonerWebCallServer/logs/gc-manager.log’: No such file or directory
cp: cannot stat ‘/usr/local/FlashphonerWebCallServer/logs/error[0-9]*.log’: No such file or directory
cp: cannot stat ‘/usr/local/FlashphonerWebCallServer/logs/*.netstat’: No such file or directory
mkdir: cannot create directory ‘conf’: File exists
mkdir: cannot create directory ‘bin’: File exists
./watchdog_event_hook.sh: line 61: cd: /usr/local/FlashphonerWebCallServer/logs/watchdog: No such file or directory
tar: report-19-10-24-21_28_40: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors
------------------------------------------------------------)
We noticed that there are no watchdog logs at all :
------------------------------------------------------------(
[root@magija FlashphonerWebCallServer]# grep -r 'watchdog' logs/
[root@magija FlashphonerWebCallServer]#
------------------------------------------------------------)
Important content of /FlashphonerWebCallServer/conf/watchdog.properties is below :
------------------------------------------------------------------------------(
wcs_core_pid=/var/run/FlashphonerMainWebCallServer.pid

client.jmx_port=50999
client.jmx_login=admin
client.jmx_password=admin
client.max_failure_count=2
client.handle_failure_interval=60000
client.failure_check_interval=60000
client.notification.email=head@gobuddies.tech
client.notify_only=true

watchdog_events=CoreProcessDown,EventScannerDown,SIPRegDoesNotWork
on_watchdog_event=watchdog_event_hook.sh
watchdog_autorun=true

server.registration.credentials=login:login,authenticationName:authenticationName,password:password,domain:domain,outboundProxy:eek:utboundProxy,port:5060
server.registration.credentials.delimiter1=,
server.registration.credentials.delimiter2=:

notify_only=true

sendmail_script=watchdog_mail_script.sh
--------------------------------------------------------)

Can you please asssit ?

Regards,
Srdjan I.
 

Max

Administrator
Staff member
Good day.
In WCS 5.2 does not work the built-in subsystem to check availability of the server (Watchdog). You can use this Bash script that determines availability of WebSocket WCS.
If WCS WebSocket is unavailable: to standard output - 0, if available - 1.
You can modify this script to send an email notification or create trigger in your monitoring system (e.g. Zabbix).
Code:
#!/bin/bash

WCS_HOME="/usr/local/FlashphonerWebCallServer"

WSS_ADDRESS="$(grep -Pv '^(#|$)' ${WCS_HOME}/conf/flashphoner.properties | grep -E 'wss.address' | awk -F '=' '{print $2}' | sed 's/^[ \t]*//;s/[ \t]*$//')"
[ -z $WSS_ADDRESS ] && WSS_ADDRESS='0.0.0.0'

WSS_PORT="$(grep -Pv '^(#|$)' ${WCS_HOME}/conf/flashphoner.properties | grep -E 'wss.port' | awk -F '=' '{print $2}' | sed 's/^[ \t]*//;s/[ \t]*$//')"
[ -z $WSS_PORT ] && WSS_PORT='8443'

curl --connect-timeout 30 --insecure --silent --include \
--no-buffer \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Host: $WSS_ADDRESS:$WSS_PORT" \
--header "Origin: https://$WSS_ADDRESS:$WSS_PORT" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
--header "Sec-WebSocket-Version: 13" \
https://$WSS_ADDRESS:$WSS_PORT/ | grep -q "HTTP/1.1" && [[ $? == 0 ]] && echo '1' || echo '0'
 
Top