I'm trying to do the following two things. I'm stuck right now
- when RINGNOANSWER for a particular operator hits count 10 for WAITTIME > 14000. alert with summary of calls
- if EXITWITHTIMEOUT > 1 per each queue, in any hour - alert with mail including queues with this issue
May be with "tail -F" for those three log files?!
Also if someone can help me to improve scripts.. I think they could be useful for other people, no only me.
I don't have any of your data to work with and the awk available on my system doesn't include the strftime() function you're using, so the following is untested (and given the number of manual edits made, is likely to contain typos). But, I find this type of code easier to follow than yours and (since it gets rid of well over 50 openings and closings of the file /var/log/asterisk_agents_log/everyday.html, reduces the number of times that directory hierarchy has to be evaluated to just once, and gets rid of several unneeded invocations of cat and grep) should run faster. I don't see any need for the file everyday.html, but I kept a tee in the script to save the data you were writing to that file if you need it for some other unrelated processing by some other script. If you don't need that file after this script completes, remove the line shown in red in the script below:
I haven't been able to follow all of your repeated updates to the awk scripts you use to create the exitempty.log, exitwithtimeout.log, and ringnoanswer.log files. And you haven't specified what format you want for the alerts you said you want to create in post #10 in this thread. Therefore, I didn't attempt to include code to address those issues in this post.
You mentioned using tail -F, but that doesn't seem appropriate. (Note that tail -F never terminates until you interrupt it. You could set a timer to kill it after you let it run for some period of time, but that seems error prone and complicated for any reason I would think you might want to use it.)
If you would like to show us your latest scripts to produce those three files, we can probably help you simplify them to get rid of unneeded invocations of cat and grep (as was done in the script above) and if you show us the alerts you want to produce from those files, we can probably help you build that into the same awk scripts.
I hope this helps...
Last edited by Don Cragun; 03-26-2016 at 09:19 PM..
Reason: Fix typo: s/Table 1/# Table 1/
This User Gave Thanks to Don Cragun For This Post:
I tried to cast ALL of this into one single awk script but was not too sure if I got the input file structures right, so YMMV. Why don't you constrain the selection with an adequate where clause on date and waittime in the first place?
However, with a file structure like
, try this
and see how far you get...
Appreciate help for the below issue.
Im using below code.....I dont want to attach the logs when I ran the perl twice...I just want to take backup with today date and generate new logs...What I need to do for the below scirpt..............
1)if logs exist it should move the logs with extention... (1 Reply)
I have a script
#!/bin/bash
HOST=ftp.example.com
USER=ftpuser
PASSWORD=P@ssw0rd
ftp -inv $HOST <<EOF
user $USER $PASSWORD
cd /path/to/file
mput *.html
bye
EOF
the script executes sucessfully I need to capture the FTP logs to a logfile
should contain
FTP Login successful
... (1 Reply)
Hi
I'm very new to unix shell scripting. Im also new here in this forum. I'm a SQL Server DBA but I'm slowly learning Oracle and Sybase DB. Our Oracle and Sybase are on Unix platforms. Im slowly learning Linux Admin and Shell Scripting to automate tasks.
I'm writing a script to view DB error... (4 Replies)
Hi,
I need write a shell script which should be executed from the crontab every day.
This shell script is running several other shell scripts , and each one of them is writing to its log file.
Few of the the shell script are also connecting using ssh to some other users on remote machine , do... (1 Reply)
Hi Experts,
I am new to shell.How to extract logs (Web,APP,Database) using shell in performance testing?
Need for webserver logs,app server logs and d/b logs code.
Thanks in advance
Sree (3 Replies)
Hi,
I have a strange situation here, I want to archive gc.logs file, generated by a java application, the strange thing about gc.log file is is doesn't have any time/date stamp appended to it unlike other logs (catalina/access/error) and one more strange thing is when ever the application is... (6 Replies)
I am currently trying to develop a script to connect to mulltiple servers, reading specifc data from log files on the servers and append the data from each file into a single tab delimited row. So, at the end I am planning to have a report with all the extracted data with each row per server. I am... (5 Replies)
Hello everyone.
I wrote the following script but the second part is not excecuting. It is not sending the notification by email if the error occurs.
the send mail is working so i think the errorr should be in the if statement
LOGDIR=/logs/out
LOG=`date "+%Y%m%d"`.LOG-FILE.out #the log file ... (11 Replies)
Hello,
I am trying to save in a file a single "*" but its not working... look what i am doing...
FILE="/home/teste/a.txt"
...BEGIN...
ASTERISK="*"
echo "STRING $ASTERISK STRING" >> $FILE
...END...
when i do it, the result is a list of all files of the current... (4 Replies)
Please share a shell script to collect logs of a server (like cpu utilization, memory etc) for a perticular time interval by giving date, time and server name as input. (1 Reply)