Pages

Wednesday, July 29, 2015

Open Positions for Server Hardware Engineer @ Thakrar Infotrendz Location Bangalore

We have an urgent requirement for Server Engineer having knowledge on servers/workstations.



Person should have Full understanding of fundamental concepts in Operating Systems (preferably Windows & Red Hat Enterprise Linux)


Experience of documenting systems


Exposure to management tools to pro-actively improve services.


Excellent problem solving and planning skills, a flexible approach with good verbal and written English communication skills



If you are interested, kindly revert with following details along with your updated resume @ Shailesh.Bhanushali@Infotrendz.com with subject Job Server Hardware Bangalore

Total Experience:
Relevant experience on Unix Or Any Servers:
Current Organisation:
Current CTC:
Expected CTC:
Notice Period:
Date of Birth:
Highest educational Qualification:
Current Location:
Alternate E-mail Id:  

Tuesday, July 28, 2015

Sarg Script for Week wise squid log generation


#!/bin/bash

if [ -f /etc/sysconfig/sarg ]; then
    . /etc/sysconfig/sarg
fi

[ "$SARG_ENABLED" == "on" ] || exit 0

# remove all weekly sarg reports older than $SARG_RETENTION days
/usr/bin/find \
    /var/www/sarg/weekly \
    -mindepth 1 \
    -maxdepth 1 \
    -mtime +$SARG_RETENTION \
    -type d | xargs /bin/rm -rf

function create_log_argv() {
    local LOG=$(echo "$1" | sed s,/var/log,/var/log/archives,)
    local COUNT=$2
    ls -1 "$LOG"-*gz 2>/dev/null | tail -${COUNT} | while read F; do
echo -n "-l $F "
    done
}

LOG_FILES=

LOG="/var/log/squid/access.log"
# this is to be backwards compatible
if [ -s "$LOG.1.gz" ]; then
LOG_FILES="$LOG_FILES -l $LOG.1.gz"
fi

LOG_FILES="$LOG_FILES $(create_log_argv $LOG 7)"

if [ -s "$LOG" ]; then
LOG_FILES="$LOG_FILES -l $LOG"
fi


[ -z "$LOG_FILES" ] && exit 0


lastdate=$(ls -Art /var/www/sarg/weekly | tail -n 1| cut -c 11-19)
year=$(echo $lastdate | cut -c 1-4)
month=$(echo $lastdate | cut -c 5-7)
oldday=$(echo $lastdate | cut -c 8-9)
oldweek=$(date --date "$oldday$month$year" +%Y%m%d)
currentdate=$(date --date "today" +%Y%m%d)


for (( logdate=oldweek; logdate<currentdate; logdate=week ))
do


# Get epoch seconds
USERDATE=$(date +%s -d $logdate)
# Subtract 1 week
((USERDATE += (60*60*24*7) ))

# Convert from epoch seconds into YYYYMMDD.
# -d assumes strings beginning with @ are epoch seconds.
week=$(date -d "@$USERDATE" +"%Y%m%d")
echo Week  $week

WEEKAGO=$(date -d "$week 1 week ago"  +%d/%m/%Y)

        echo    currentdate             $currentdate
        echo    logdate                 $logdate
        echo    WEEKAGO                 $WEEKAGO
        YESTERDAY=$(date --date $week  +%d/%m/%Y)
        echo yesterday $YESTERDAY
        echo ============================
/usr/bin/sarg $LOG_FILES -o /var/www/sarg/weekly -d $WEEKAGO-$YESTERDAY


done

Sarg Script for Day wise squid log generation

#!/bin/bash

if [ -f /etc/sysconfig/sarg ]; then
    . /etc/sysconfig/sarg
fi

[ "$SARG_ENABLED" == "on" ] || exit 0

# remove all daily sarg reports older than $SARG_RETENTION days
/usr/bin/find \
    /var/www/sarg/daily \
    -mindepth 1 \
    -maxdepth 1 \
    -mtime +$SARG_RETENTION \
    -type d | xargs /bin/rm -rf

function create_log_argv() {
    local LOG=$(echo "$1" | sed s,/var/log,/var/log/archives,)
    local COUNT=$2
    ls -1 "$LOG"-*gz 2>/dev/null | tail -${COUNT} | while read F; do
echo -n "-l $F "
    done
}

# Get yesterday's date
#YESTERDAY=30/03/2014
#YESTERDAY=$(date --date "yesterday" +%d/%m/%Y)
LOG_FILES=

LOG="/var/log/squid/access.log"
# this is to be backwards compatible
if [ -s "$LOG.1.gz" ]; then
LOG_FILES="$LOG_FILES -l $LOG.1.gz"
fi

LOG_FILES="$LOG_FILES $(create_log_argv $LOG 1)"

if [ -s "$LOG" ]; then
LOG_FILES="$LOG_FILES -l $LOG"
fi

# if no logfiles are present then exit
[ -z "$LOG_FILES" ] && exit 0

#exec /usr/bin/sarg \
#$LOG_FILES \
#-o /var/www/sarg/daily \
#-d $YESTERDAY &>/dev/null


lastdate=$(ls -Art /var/www/sarg/daily | tail -n 1| cut -c 1-9)
year=$(echo $lastdate | cut -c 1-4)
month=$(echo $lastdate | cut -c 5-7)
oldday=$(echo $lastdate | cut -c 8-9)
currentdate=$(date --date "today" +%d)

for (( logdate=oldday; logdate<=currentdate; logdate++ ))
do
        echo    lastdate                $lastdate
        echo    day                     $oldday
        echo    currentdate             $currentdate
        echo    logdate                 $logdate

        YESTERDAY=$(date --date $logdate$month$year  +%d/%m/%Y)
        echo yesterday $YESTERDAY
/usr/bin/sarg $LOG_FILES -o /var/www/sarg/daily -d $YESTERDAY
        echo ============================
done


Thursday, July 23, 2015

Aix On Serial Console

Findout available TTY

lsdev -Cc tty

the output must be vty0 or tty0
if its on vty0

lsattr -El vty0 | grep login

By default its disabled in many servers

chdev -l vty0 -a login=enable

If you do not have a terminal defined, that is, lsdev -Cc tty did not display an output, from an remote session run "smit tty" ->add a tty->select the remaining as per your settings.

select optopn "Enable Login", set it to enable.