Programming :: Script To Read Active Squid Logfile And Output Results To Html Based On Conditions?
Mar 12, 2010
Basically the requirement of the script are :
1. need to run like a daemon which will read an active squid logfile in a refresh pattern of 5 minutes
2. calculate the total number requests based on different domains that the client access
3. calculate the total of number of requests based on different domains as well as the turnaround time of these access is more than 5 sec that the client access
4. calculate percentage of item 3 over item 2
5. report the results in html format as follows:
Domain Name Total req Req > 5 sec % of req > 5 sec
6. able to access the results from web browser.
View 8 Replies
ADVERTISEMENT
Jun 10, 2010
I have multiple HTML files in a folder. there is a <h2> tag like this:
Code:
<h2>some text</h2>
in each file. I want to write a shell script/batch file to add this tag in <head> section of each file:
Code:
<!-- TITLE= "same text from h2 tag" -->
Note that <h2>some text</h2> in some files has 1 or more linebreaks and so I couldn't capture tag content using a simple grep or...
for example:
<h2>first part of text
second line of text</h2>
The line break shouldn't be shown in <!-- TITLE= "same text from h2 tag" -->. The script has to capture tag content & skip line breaks.
View 3 Replies
View Related
Apr 5, 2011
I have a log file with entries such as;
Where result is 0 or more.
I want to get the list of file names where result count is more than 0 (in other words filter out files names with result 0).
File name and result are in two different lines in log file.
How can i filter file name based on result?
View 5 Replies
View Related
May 9, 2010
Im running a dedicated game server for ArmA-II. There is a server.cfg file that directs the server to output to a log file all server events, such as game issues from clients and the server itself.The value in the server.cfg file looks like this: logfile="server.log";How do I set it up so that the dedicated server outputs this information, not only to the log, but also to my screen? Would this be done from the server.cfg file?
View 1 Replies
View Related
Mar 15, 2010
i have wrote a long piece of code above with the "main" which is calling openFile( &fout, filename )filename contains the txt name in a form of "data.txt"i wanna read the data from the file and output it into fout for later use.the data in that file is a vector looking interger group.i have the following code:
int openFile( ofstream * fout, const char * filename)
{
ifstream iFile(filename);
[code]...
View 1 Replies
View Related
Jan 20, 2009
when the user clicks a button (assume war application) and the action'system.out.println' a message, how can I *remotly* read this message (read the message from a different computer instead of the server)?when I use the eclipse, I can read it from the console but if I'm in adifferent location, how can I see this message remotely?I'm thinking about remote debugging (JPDA), however, it's very difficult to configure in order to make JPDA run. I tried based on tutorial of google search, bug failed.I wonder if remote debugging can actually solve my problem. If not, is there any other to solve
View 1 Replies
View Related
Dec 10, 2010
I have the following code:
Code:
#include <stdio.h>
#include <stdlib.h>
int main() {
system("ps -ef | grep myprocessname");
return 0; }
When I run this program it outputs the following list of running processes:
Code:
root 10279 10275 0 13:02 ? 00:00:00 myprocessname myvar1=value1 myvar2=value2
root 10341 10337 1 13:02 ? 00:00:00 myprocessname myvar1=value1 myvar2=value2
What I want to really do is instead of writing the output to screen I want to read the output and parse the various values value1, value2 etc. What is the best way to do this?
View 4 Replies
View Related
Jul 27, 2010
I am splitting a file based on the values read from an input file. The below one is the script.
1)How do I add the header which is present in the original file to the new split files created?(For eg. pharmacyf conatins header as table column names. The new files created (ODS.POS.$pharmacyid.$tablename.$CURRENT_DATE.dat) are without the header).
2) Also the script is creating 0 byte files for the pharmacyids which are not available in the intial file? Can this be avoided?
for pharmacyf in *
do
tablename=`echo $pharmacyf |cut -f4 -d'.' `
while read pharmacyid
do
grep -w $pharmacyid $pharmacyf >> $OUT/ODS.POS.$pharmacyid.$tablename.$CURRENT_DATE.dat
done< inputfile
done
View 2 Replies
View Related
Sep 12, 2009
what is the best way (i.e standard way that is supported on all browsers and probably as well followed by web crawlers).... to include an html file either locally or externally in another ? Of course , i've done the research and i also know that there are server side includes (php , asp ...you name it) at the moment , i'm using this:
Quote:
<script type="text/javascript" src="path to file/include-file.js"> </script>
however, i've been warned that this method may not show up in some browsers as some tend to ignore this tag and that crawlers like your favorite search engine wouldn't bother reading this. so , what is the best and safest way to do the job? and btw , the reason why i've ousted SSI's from the start is because of among other things:
1) the fact that the included file is static html and because the text is included pretty much everywhere
2) hoping to reduce load time as the code (if successfully recognized) would hopefully be treated like any other embedded external file (e.x like an image) , therefore it would be cached without the need to downloaded it over and over again for each new page on the site.
View 1 Replies
View Related
Jul 12, 2010
I am trying to install squid with active directory authentication following the steps from http://wiki.squid-cache.org/ConfigEx...ctiveDirectory
I am getting a couple of errors how to rectify them the linux os i am using is centos 5.4 and windows 2008 ADS.
I was successfully able to join to the domain
View 1 Replies
View Related
Apr 14, 2011
How to configure squid with active directory
View 1 Replies
View Related
Jul 22, 2010
does any one knows a linux based program/script that can generate html files based on directory structure?
View 1 Replies
View Related
Feb 4, 2010
Is there a way to cache everything in squid except for the video files and mp3s?I had a problem before when I turned caching on and it made the performance very poor because it was trying to cache large video files.Right now, I have a problem on the server where even if iptraf lists ingoing+outgoing at 5000 kbits/sec viewing video works fine, but it takes a while for normal webpages to load and I can't figure out where the bottleneck is.
View 12 Replies
View Related
Jul 19, 2009
I have configured squid with AD. It is working fine. Now I want to use dansguardian with squid for web filtering on group bases, what should I do. What configuration i have to do in squid for dansguardian and all my users in AD also authenticate with dansguardian and also how I use dansguardian.
View 1 Replies
View Related
Dec 30, 2010
I'm using squid 2.6, Win2008 AD server. Clients are using winxp, win7. how to config squid for the authentication with win2008 AD?
View 2 Replies
View Related
Nov 11, 2010
I have a squid server currently running with basic authentication. This is a must because we constantly have different people using different machines but the rules must be set per user, not per machine.
We also have a lot of users coming and going. So every time a new user comes to the office I have to manually create a user for him so he can authenticate.
Anyway.. We do not have any windows servers so no Active Directory. But I need some solution to pass the windows login to Squid.
First question: It seems I am using NTLM currently for samba as the person can map their home directories on their windows box withuot authenticating. Why can I not use it for squid?
Second question: Can I make my Centos server into an AD server?
View 1 Replies
View Related
May 20, 2010
I have created which uses Gnome Seed which is in the Ubuntu repositories (although the newest version needs to checked out from Git to allow it to work) and SeedKit which unfortunately isn't in synaptic but needs to be downloaded. The links to get the source for both projects are as follows:
[URL]
The proof of concept is a JavaScript/HTML based frontend of Gnome's Log Viewer. It doesn't replicate 100% of Log Viewers functionality but it produces the basics of it which is to display the contents of Linux log files. The tutorial and link to download the source files are as follows:
[URL]
For more information about SeedKit and HTML based User Interfaces are in my blog, link for that post is as follows:
[URL]
View 2 Replies
View Related
May 23, 2011
How to setup squid on opensuse with active directory authenticaton.
View 1 Replies
View Related
Feb 21, 2010
In linux, I can grep a string from a file using grep mySearchString myFile.txt.
How can I only get the result which are unique?
View 1 Replies
View Related
Oct 5, 2010
I've got this current configuration : 1 squid server authenticating with 1 forest abc.com, then another company wants to joint but in different forest efg.com, I've already configured trust relationshipt between them.
How should I configured at squid.conf so it will authenticate both domain ?
At squid.conf I've already configured like the following below for abc.com :
Is it enough to adding a new line for auth_param basic program for efg.com ?
View 1 Replies
View Related
Jan 28, 2010
I'm fairly new to Linux and very new to Squid and am having authentication issues! I am using Oracle Enterprise Linux (which is basically Red Hat without the branding) and wanting to use Squid Proxy Server for web access with authentication to Active Directory. I've found a number of articles about this online and all of them say to use auth program squid_ldap_conf which should be in /usr/lib/squid/. I don't have a squid directory in /usr/lib for starters and my squid binaries are in /etc/squid but there is no squid_ldap_conf in there either. I have installed the latest version of Squid (3.0) to see if that helped but I still cannot find the authorisation program.
View 3 Replies
View Related
Oct 5, 2010
I would like to be able to get squid or dansguardian to authenticate a user account against active directory so that a users browsing activities can be logged.
I can find lots a very useful info on how to set up ntlm_auth etc, but all of these methods produce a pop up window when the user launches the browser.
I'm posting this thread because I would like to be able to authenicate, but without a pop up window. Is there a way of automatically carrying out this authentication so that the user is unaware of it.
We've previously attempted authenticating against an NT4 PDC, but the users worked out that they could use any user account on the network, not just the user that was logged in which kinda defeated the whole idea of logging the users activity.
My current setup is:
Windows 2003 AD
Windows XP Clients, soon to be converted to windows 7.
Fedora 11 running squid and dansguardian.
View 2 Replies
View Related
Jul 28, 2010
How to output to a text file the compound command:
Code:
find -type f -print0 | xargs -0 grep -l "desired text"
I have not been able to find the answer.
[code]...
View 5 Replies
View Related
Apr 6, 2011
I need to block mac address in my network then i foolowed as below acl's but am getting output as follows I tried as in /etc/squid/squid.conf acl block arp aa:aa:yy:yy:xx:xx http_access deny block but it give me error as like: - (This is the output of # squid -k parse) aclParseAclLine: Invalid ACL type 'arp' FATAL: Bungled squid.conf line 1234: acl block arp aa:aa:yy:yy:xx:xx squid Cache (Version 2.5.STABLE6): Terminated abnormally.
View 7 Replies
View Related
Jan 8, 2010
Is there anyway to convert standard output to html ?
for example I wanna convert a colored file like this:
Code:
git diff -u --color-words --no-index ~/file1 ~/file2 > my_colorized_output
I wanna convert my_colorized_output ( or anything else ... ) to html format.
View 3 Replies
View Related
Feb 5, 2010
I have running on RHL enterprise 4. I want to configure squid users to authenticate against windows 2003 active directory. How do I go about from scratch
View 1 Replies
View Related
May 20, 2011
Somehow, the wife got her laptop into this situation yesterday. The Windows partition booted normally when selected from GRUB but os 11.3 would boot to a command line login and pretty much everything besides CTRL-D was useless as the root partition was ro.
I booted a live CD and found two a couple of strange things. First, the system clock was reset to the default date/time (2007-xx-xx). I reset that. Second, after correcting the time I ran fsck on the root and home partitions. Both went through with no errors reported but the 20GB root partition took a long,long time to complete while the 80GB home partition went pretty quickly. After doing the above, the system booted normally but both partitions reported running the transaction log as well as forcing fsck where I had just done that. My question is for future reference: how does the system react to a grossly incorrect date/time, especially where all the drive data reports being much later than the reported system time? Would this be the reason for what I saw? I have no idea how the wife managed to reset the system clock, even if the
View 2 Replies
View Related
Aug 20, 2010
I have configured squid proxy on centos 5.5 and some of my squid.conf file has following lines
Code:
http_access allow ncsa_users office
There are 3 users called "user034, user035 and user050" in the /etc/squid/squid_passwd file need to restricted access to internet except sites www.abc.com form anywhere in the lan. Once they logged in any ip, rule should apply.(that means no ip related acl, only user name related) How can I configure this in squid.
View 3 Replies
View Related
Jan 20, 2011
I want to implement squid with quota restriction based on username.
View 4 Replies
View Related
Feb 4, 2010
is it possible to set a local html page as the desktop as in active desktop in windows.
View 1 Replies
View Related