Archive for June, 2010

Cisco:Routing protocols OSPF

Tuesday, June 29th, 2010

How to setup OSPF routing :
How to view what protocols is running:

show ip protocols

how to kill rip protocols (if exists)

configure terminal
no router rip

How create OSPF protocols

configure terminal
router ospf 1 [ here 1 is the process id, which has to be same to every router in the organization ]
network 192.168.1.1 0.0.0.0 area 0
Or
network 192.168.1.0 [...]

Nagios script to monitor memory uses

Thursday, June 24th, 2010

#!/bin/bash
 
#Version 1.0
#######################################
#Nagios scrept to check memory status##
#Commands : free -m#####################
#######################################
 
 
#Status check for nagios script
 
STATE_OK=0
STATE_WARNING=1
STATE_CRITICAL=2
STATE_UNKNOWN=3
STATE_DEPENDENT=4
 
 
#Define All the variables for commands
 
declare -rx SCRIPT=${0##*/}
declare -rx CMD_AWK="/bin/awk"
declare -rx CMD_CAT="/bin/cat"
declare -rx CMD_FREE="/usr/bin/free"
#####Section 1.1 :D efinning function for free memory checking########
#Definning function to check free memory status#####################
#####################################################################
 
function FUNC_FREE_CMD
 
{
 
MEM_STATUS=$( $CMD_FREE -m | grep buffers/cache | awk ‘{print $4}’)
 
 
########Checking if Current memory [...]

Cisco:Basic Commands to setup vlan

Wednesday, June 16th, 2010

Trunking:
(1)Create trunk ports between 2 switch:
to setup trunk between port F0/11 and F012 of Switch S1
For Port F0/11

configure terminal
interface fastEthernet 0/11
switchport mode trunk
note : if upper commands say : command rejected with error : Trunk encapsulation is Auto, then do the followings
switchport trunk encapsulation dot1q
Now type again : switchport mode trunk

For Port F0/12

configure terminal
interface [...]

Mysql Server processlist shows negative value(-) in connect column for system user

Wednesday, June 9th, 2010

Some times process list out put show negative value like bellow :
Command :

watch /usr/local/mysql/bin/mysqladmin -ppass processlist

8 | system user | | Connect | -1247 | Has read all relay log; waiting for the slave I/O thread to update it |
One of the reason :
make sure both Server has same [...]

How To Set Up MySQL Database Replication With SSL Encryption

Wednesday, June 9th, 2010

Step1 :
Set up normal replication first and find out if mysql server is compiled with ssl supports
Ref:http://www.fosiul.com/index.php/2009/11/mysql-server-master-master-active-active-replication/
Bellow commands will verify if mysql server is compiled with ssl supports

SHOW VARIABLES LIKE ‘have_openssl’;

output :
Step2 :
in Server1 :
(a)Create Self signed certificate .
Note : While Creating self signed certificate use different common name for each certificate,other wise it will [...]

nagios script to check dns servers status

Monday, June 7th, 2010

#!/bin/bash
###################################
#Purpose:################################################################
###(a) Monitor if all your name server is online: Status :D one ####
###(b) Monitor if all name server has same zone record : Staus : Ongoing##
###(c) Monitor the Response time of Dns server : Status : Ongoing#
#########################################################################
 
#Status check variables for nagios [...]

Linux:How to run c program in linux

Friday, June 4th, 2010

1. Open an editor in linux Example vi editor
2. Write a simple program and save it as progra1.c

#include <stdio.h>
int main (void)
{
printf ("Programming is fun.\n");
return 0;
}

3. compile the program : $ gcc prog1.c
4. Run the program : ./a.out
Or
5.you can give it a different name : gcc prog1.c –o prog1
Now run the program [...]