Sponsored Content
Full Discussion: Traffic Monitoring Script
Top Forums Shell Programming and Scripting Traffic Monitoring Script Post 302589706 by Siddheshk on Thursday 12th of January 2012 11:37:32 AM
Old 01-12-2012
Traffic Monitoring Script

Hello All,

I have written a script to check for http error code 500 in the logs.

here is the code
Code:
#!/bin/bash

#########################################################################################################
# Shellscript    :    trafficchk.sh -Traffic Monitoring
# Version    :    V1.0
# Owner         :    SiddheshK <siddheshk@maildomain.com>
# Date        :    2012-01-12
# Category       :    Files Management
#########################################################################################################
# Description:  This scipt will Monitor traffic on each XMP service blades and for HTTP error 500
#            
#########################################################################################################

#Defining Variable
#------------------------
LOG_FILE=/var/xmp/log/XMP_*| tail -1 
HTA_STATUS=`logscan -in $LOG_FILE -live |grep HTA_ResponseStatus: 500|wc -l

if [ $HTA_STATUS -gt 500 ]; then
 echo " Too many HTTP 500 Errors observed in activity log !!! "

printf "*****  XMP Application Alert System  *****\n\nHost: `hostname` \n\nHost_Address: \n\nInfo:Internal Error:500 \n\nDATE:`date` \n\n" | /bin/mail -s "Host `hostname` --HTTP-Internal Error:500 observed...Please Check Immeiately " siddheshk@maildomain.com

fi

exit 0

I have a issue with one thing here.

Code:
HTA_STATUS=`logscan -in $LOG_FILE -live |grep HTA_ResponseStatus: 500|wc -l

The above mentioned logscan command, does not end automatically and needs to be killed manually (ctrl+c)

How do i implement the same in script.

Regards,
Siddhesh.K

Last edited by methyl; 01-13-2012 at 09:23 AM.. Reason: remove real names
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

monitoring network traffic

there are commands to monitor the memory, paging, io... how about network traffic. i mean commands to see whether the network traffic (LAN) is congested? the closest i got is netstat thanks (6 Replies)
Discussion started by: yls177
6 Replies

2. UNIX for Advanced & Expert Users

Monitoring network traffic using snoop

I want to monitor network traffic. For this purpose i use snoop command. But snoop command only show those packets which are broadcasted or those packets which recieved by host. But I want to examine whole network traffic. Please tell me how to use snoop for monitoring whole network traffic or if... (3 Replies)
Discussion started by: mansoorulhaq
3 Replies

3. UNIX for Dummies Questions & Answers

NIC card monitoring traffic question

Folks; I have 2 NIC cards on my SUSE Linux server. One of them was reporting receive errors for a while now it's OK, but i'd like to monitor it. Is there any command i can run to tell me the usage in the past or give me a history of traffic and the speed that going on this specific card? I... (1 Reply)
Discussion started by: Katkota
1 Replies

4. Cybersecurity

Monitoring network traffic on wireless router

Hi all, How can I monitor packet traffic on my wireless router? Some info - my wireless router is netgear wgr614 - everyone can connect it i.e. no password required - I would like to see where they connect, how they are using the internet connection I installed wireshark and captured... (3 Replies)
Discussion started by: SaTYR
3 Replies

5. HP-UX

Monitoring traffic in the network

I Colleagues, Somebody can say me how to monitoring traffic in the network. also I am interested in monitoring memory. if somebody to know a guide with command advanced in unix welcome for me. Thank you for adcanced. (0 Replies)
Discussion started by: systemoper
0 Replies

6. AIX

Script for real time network traffic per process

Hi All Gurus, I want to write a script (bash/ksh/csh) which will show real time network traffic ( TCP or UDP ) generated by per process/PID. For both Linux/AIX system, as nethogs ( Linux package ) shows ? Any suggestion is MOST welcome. Thanks in Advance, Amritendu Das (1 Reply)
Discussion started by: linux.amrit
1 Replies

7. Shell Programming and Scripting

Script for real time network traffic per process

Hi All Gurus, I want to write a script (bash/ksh/csh) which will show real time network traffic ( TCP or UDP ) generated by per process/PID. For both Linux/AIX system, as nethogs ( Linux package ) shows ? Any suggestion is MOST welcome. Thanks in Advance, Amritendu Das (3 Replies)
Discussion started by: linux.amrit
3 Replies

8. Shell Programming and Scripting

Help with a script for proxy traffic

Hello folks; I'm trying to write a script to test our proxy servers to see if they're passing traffic and i need help please. I wrote this code below to implement "httpie" tool but still having issues. Can someone please take a look and let me know what's wrong with this code? The code is supposed... (2 Replies)
Discussion started by: Katkota
2 Replies
NSIS(1) 							      GenPat								   NSIS(1)

NAME
GenPat - A program to create patch files in VPatch format. SYNOPSIS
GenPat [-R] [-B=64] [-V] [-O] [-A=500] [source] [target] [patch.pat] DESCRIPTION
This manual page documents briefly the GenPat command. This manual page was written for the Debian (TM) distribution because the original program does not have a manual page. Instead, it has documentation in the HTML format; see below. GenPat is a program that creates installer programs for Windows. OPTIONS
-R Replace a patch with same contents as source silently if it already exists. -B=64 Set blocksize (default=64), multiple of 2 is required. -V More verbose information during patch creation. -O Deactivate match limit of the -A switch (sometimes smaller patches). -A=500 Maximum number of block matches per block (improves performance). Default is 500, larger is slower. Use -V to see the cut-off aborts. EXIT STATUS
0 Success 1 Arguments missing 2 Other error 3 Source file already has a patch in specified patch file (=error) SEE ALSO
GenPat is documented more fully in the HTML file /usr/share/doc/nsis/Docs/VPatch/Readme.html. AUTHOR
This manual page was written by Paul Wise pabs@debian.org for the Debian (TM) system. AUTHOR
Paul Wise Created man page COPYRIGHT
Copyright (C) 2005 Paul Wise GenPat manual October 5, 2005 NSIS(1)
All times are GMT -4. The time now is 01:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy