Archive

Posts Tagged ‘bash’

script to monitor cpu usage by process

March 12th, 2014 1 comment

A bash script to get the CPU usage by process
usage:
nohup ./check_proc bwengine 70 &

bwegnine is the process name we want to monitor
70 is to log only when the process is using over 70% of the CPU.

Read more…

Categories: BashScripts Tags: , , , ,

bash get analytics data

December 17th, 2013 No comments

This is a bash script to get Google Analytics Data, in this case A total day Pageviews.

Here is the code:

Read more…

Categories: HowTo, Linux Tags: , , , , , ,

Run jenkins with another user

December 13th, 2013 No comments

How to configure jenkins to run under different user other then tomcat6 account.

I configured it to run a bash script using:
sudo -u ubuntu /opt/script

Read more…

Categories: HowTo, Linux Tags: , , , ,

check_error_log

December 6th, 2013 No comments

Yet another log monitoring script..
The date field is very specific for each system and I keep having to refix each time.

Read more…

varnish dynamic backend

June 14th, 2013 1 comment

Varnish pointing to a Amazon ELB (elastic load balance) does not work.
Error:
Backend host “XXXXXXXXXXX-123456789.us-east-1.elb.amazonaws.com”: resolves to multiple IPv4 addresses.
Only one address is allowed.

Read more…

check how many files in a directory

June 7th, 2013 3 comments

Script to count how many files exists in directory and subdirectories
based on Gerd Stammwitz original script.

Read more…

Categories: BashScripts Tags: , , , , ,

auto scale script

May 14th, 2013 No comments

This can help if you are creating any kind of auto scale on Amazon AWS.
It is not a 100% automatic, as you will need to prior to running this have:

Read more…

Categories: Amazon-AWS, HowTo Tags: , , , , ,

check logfiles script

April 17th, 2013 2 comments

Not so generic way to check ‘any’ logfile for erros

I have written at least about 5 variations of this same script. Some more flexible and genereal purpose.
But in the end I have been writing customs made out of this skel.

Read more…

Categories: Nagios, plugins Tags: , , , , ,

TCP Send-Queue

October 3rd, 2012 No comments

Script to monitor the TCP Send-Queue.
Send-Q is retrived from the netstat cmd. ex.:

#netstat -anp |more
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name

Read more…

Categories: Linux, Nagios Tags: , , , , ,

File cleanup script for Linux

May 2nd, 2012 1 comment

Sometimes disks fill up with logs for example, and we the administrators have to
login sometimes even wake up just to delete log files! Well this script solves the problem.
In this case I used to cleanup Glassfish log files. Just setup it on cron with X amount
of days to keep files. Carefull because its recursive.

Read more…

Categories: BashScripts Tags: , , , , , ,