Dear all,
I start to build script(s) for few tasks, and I'll use log files to complete the following:
1) when ringnoanswer for a particular operator hits count 10 for waittime > 14000 send mail alert with summary of calls
2) per queue - exitwithtimout > 1 in any hour, then send mail alert.
3) 7am each morning mail report showing count for each operator that was logged in
the previous day (i.e. midnight to midnight from day before) with total ringnowanswer > 14000 wait time.
So I have plan to use cron tasks, and bash scripts with queue_log grep for EXITEMPTY, EXITWITHTIMEOUT, RINGNOANSWER, operator name and queue number.
Well, that is just plan for now. Please if you have any ideas, could you please share.. ? May be there is easier way to do this.. I have zabbix already, and data needed is there in sql database. May be there is a way to pull the needed data from there?
thanks in advance
OS: CentOS
Asterisk 11.18.0
---------- Post updated at 12:56 PM ---------- Previous update was at 04:35 AM ----------
My first step is created user "select" for mysql and the following:
mysql -u select -D zabbix -e "select clock,value from history_log" > /tmp/text.log
The output is:
1458182176 1458182148|1458182143.44543|1111|NAME NAME|RINGNOANSWER|4000
1458183289 1458183261|1458183252.44657|1111|NAME NAME|RINGNOANSWER|9000
1458183410 1458183393|1458183388.44682|1111|NAME NAME|RINGNOANSWER|4000
1458183621 1458183596|1458183592.44700|1111|NAME NAME|RINGNOANSWER|4000
So I believe my next step should be to make unix time into readable, may be using:
awk '{ print strftime("%c", $0); }'
I have no idea how to grep only with waittime > 14000 (this is last value after RINGNOANSWER), and how to add them into new text file (may be using cron and update text file with new results instead to rewrite the file every time). After that to check if there is NAME > 10, and if true to send mail with output. This may be will lead to new problem - duplicate emails, so may be when NAME > 10 is true, on email to clear the text file.
Please .. someone.. give idea

