Configure dell openmanage with snmp

Saturday, June 25, 2011 |

Overview

Dell openmanage tools are handy for system admins to manage and monitor hardware. This tool can be integrated with snmp to send  traps to monitoring servers (any snmp trap receivers). 



Install Dell openmanage tools

wget -q -O - http://linux.dell.com/repo/hardware/latest/bootstrap.cgi | bash 
yum install srvadmin-all
 
Configuring SNMP
 
Ensure that net-snmp package is installed and running on the box
[root@blackbox ~]# rpm -qa | grep net-snmp
net-snmp-libs-5.3.1-14.el5
net-snmp-5.3.1-14.el5
[root@blackbox ~]#
[root@adm-nb-01 ~]# /etc/init.d/snmpd status
snmpd (pid  31771) is running...
[root@adm-nb-01 ~]# 

Enable SNMP for Dell openmanage
 
[root@blackbox sbin]# /etc/init.d/dataeng enablesnmp
NOTE: snmpd must be restarted to activate changes to /opt/comcast/snmp/etc/snmpd.conf
Data Engine SNMP enabled
[root@blackbox sbin]#  

The above command will add following entry in the snmpd.conf

# Allow Systems Management Data Engine SNMP to connect to snmpd using SMUX
smuxpeer .1.3.6.1.4.1.674.10892.1
 
Add your snmp trap trap receiver to the snmpd.conf. This can be a 
snmptt with Nagios, cacti, Netcool, spectrum etc with Dell open 
manage mibs exported to it 
 
trapsink snmptt-server community-string
 
Restart SNMPD and Dell openmanage
 
[root@blackbox sbin]# /etc/init.d/snmpd-isst restart
Stopping snmpd:                                            [  OK  ]
Starting snmpd:                                            [  OK  ]
[root@blackbox sbin]#  
[root@blackbox sbin]# /etc/init.d/dataeng restart

Shutting down DSM SA Shared Services:                      [  OK  ]


Stopping Systems Management Data Engine:
Stopping dsm_sa_snmpd: Not started                         [FAILED]
Stopping dsm_sa_eventmgrd:                                 [  OK  ]
Stopping dsm_sa_datamgrd:                                  [  OK  ]
Stopping Systems Management Device Drivers:
Stopping dell_rbu:                                         [  OK  ]
Starting Systems Management Device Drivers:
Starting dell_rbu:                                         [  OK  ]
Starting ipmi driver: Already started                      [  OK  ]
Starting Systems Management Data Engine:
Starting dsm_sa_datamgrd:                                  [  OK  ]
Starting dsm_sa_eventmgrd:                                 [  OK  ]
Starting dsm_sa_snmpd:                                     [  OK  ]
Starting DSM SA Shared Services:                           [  OK  ]
[root@blackbox sbin]# 

IP v6 on RHEL5

Monday, November 22, 2010 |


Yes..! We are running short in V4 IP addresses. Here explains a way to configure ipv6 on your RHEL box.

1. Operating System Version should be RHEL 5 or higher

[bbaby@blackbox ~]$ more /etc/redhat-release
Red Hat Enterprise Linux Server release 5.3 (Tikanga)
[bbaby@basilvm ~]$ uname -r
2.6.18-164.11.1.el5
[bbaby@blackbox ~]$

(kernel subversion (3rd field) must be 15 or higher)

2. Confirm IPv6 is running

modprobe will check whether ipv6 module is loaded to kernel or not. FATAL error is expected.

[root@blackbox ~]# modprobe --dry-run --first-time ipv6
FATAL: Module ipv6 already in kernel.
[root@blackbox ~]#

Make sure that interface is enabled with ipv6

[root@blackbox ~]# cat /proc/net/if_inet6
00000000000000000000000000000001 01 80 10 80 lo
fe8000000000000002163efffe528f78 03 40 20 80 eth0

[root@blackbox ~]# grep NETWORKING_IPV6 /etc/sysconfig/network
NETWORKING_IPV6=yes
[root@blackbox ~]#


2a. Check interfaces

# ifconfig -a eth0 Link encap:Ethernet HWaddr 00:16:3E:52:8F:78
inet addr:192.168.200.206 Bcast:192.168.200.255 Mask:255.255.255.0 inet6 addr: Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:14363 errors:0 dropped:0 overruns:0 frame:0
TX packets:1302 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:21384433 (20.3 MiB) TX bytes:118347 (115.5 KiB)
lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:8 errors:0 dropped:0 overruns:0 frame:0 TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:560 (560.0 b) TX bytes:560 (560.0 b)
sit0 Link encap:IPv6-in-IPv4 NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)


In this example, there is only one physical interface, eth0. In Red Hat Linux, there will be a file /etc/sysconfig/networking-scripts/ifcfg- for each interface. This file will have directives that control the interface configuration:

3. Determine the IPv6 subnet address based on the router advertisement


The router advertisement on this segment is 2001:558:ff40::. This information will be used to compose the static IPv6 address. The algorithm to create an IPv6 address from an IPv4 address is simple (in my network). Take the currently assigned IPv4 address for the device in question and make them the last four entries of the IPv6 address.

# cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 BROADCAST=192.168.200.255
HWADDR=00:16:3E:52:8F:78
IPADDR=192.168.200.206
NETMASK=255.255.255.0
NETWORK=192.168.200.0
ONBOOT=yes

3. Determine the IPv6 subnet address based on the router advertisement


# netstat -A inet6 -rn





The router advertisement on this segment is 2001:558:ff40::. This information will be used to compose the static IPv6 address. The  algorithm used here to create an IPv6 address from an IPv4 address is simple. Take the currently assigned IPv4 address for the device in question and make them the last four entries of the IPv6 address.

If there is no IPv6 router advertisement on the segment, there is no way to guarantee what the specific subnet will be. The global IPv6 address prefix for my network  is 2001:558. The next two groups of the IPv6 address are the subnet prefix and are completely dependent on the router configuration. If this command reveals no IPv6 router advertisement, there is no mechanized way to create the IPv6 address.

 

4. Confirm the IPv4 address of the interface that will have a static IPv6 address
 
From the output in step 2, the IPv4 address of eth0 is 192.168.200.206

5. Construct the basic IPv6 address from the router advertisement and the IPv4 address

 
A full static IPv6 address is now created by putting the global address, subnet, and IPv4 address together. Our guideline for creating an IPv6 address from an IPv4 address is very mechanical. Recall that an IPv6 address consists of eight groups of four hexidecimal digits. The eight groups are populated from left to right as follows. The first two groups of four are the  global IPv6 address (2001:0558). The next two groups of four digits are created from the router advertisement determined in section 3. The final four groups of four digits are populated directly from the IPv4 address as straight numbers.
 

Please note that there is no direct binary or decimal or hexidecimal translation involved in this population. Each one of the four IPv4 address numbers becomes one of the final four groups of the IPv6 address in decending order. In this example, the IPv4 address of 192.168.200.206 transposes into the full IPv6 address of:2001:558:ff40::192:168:200:206
The subnet length should always be a /64, so the full IPv6 address becomes: 2001:558:ff40::192:168:200:206/64


This will become the static IPv6 address assigned to the chosen interface. See RFC4291 for full details on IPv6 address formats. One might note that the IPv4 address numbers are decimal representations of hexidecimal digits and that the IPv6 address numbers are actual hexidecimal digits.

6. Assign the IPv6 address to the chosen interface.


The static IPv6 information needs to be added to the file ifcfg-. The address composed in step 5 must be added as "IPV6ADDR=". Further, the directive "IPV6INIT=yes" must be added to the file to ensure the This may be manually edited or executed from the command line:

echo 'IPV6ADDR=2001:558:FF40::192:168:200:206/64'  >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo 'IPV6INIT=yes' >> /etc/sysconfig/network-scripts/ifcfg-eth0


6.a. Confirm the contents of the ifcfg- file

# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 

BROADCAST=192.168.200.255
HWADDR=00:16:3E:52:8F:78
IPADDR=192.168.200.206
NETMASK=255.255.255.0
NETWORK=192.168.200.0
ONBOOT=yes
IPV6ADDR=2001:558:FF40::192:168:200:206/64
IPV6INIT=yes


7. Bringing up the static IPv6 address without rebooting

 
Since Red Hat should already have IPv6 services running, adding the static IPv6 interface without rebooting is straightforward

# ifconfig eth0 inet6 add 2001:558:FF40::192:168:200:206/64
# ifconfig eth0 eth0
Link encap:Ethernet HWaddr 00:16:3E:52:8F:78
inet addr:192.168.200.206 Bcast:192.168.200.255 Mask:255.255.255.0 inet6 addr: 2001:558:ff40:0:192:168:200:206/64 Scope:Global inet6 addr: fe80::216:3eff:fe52:8f78/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:827 errors:0 dropped:0 overruns:0 frame:0 TX packets:677 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:86866 (84.8 KiB) TX bytes:92325 (90.1 KiB)


8. Confirmation of IPv6 connectivity

 
A simple IPv6 ping test of a valid IPv6 address will confirm whether IPv6 is working; e.g.

# ping6 -c 1 2001:558:ff40::192:168:200:200 

PING 2001:558:ff40::192:168:200:200(2001:558:ff40:0:192:168:200:200) 56 data bytes 64 bytes from 2001:558:ff40:0:192:168:200:200: icmp_seq=0 ttl=255 time=0.614 ms
--- 2001:558:ff40::192:168:200:200 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.614/0.614/0.614/0.000 ms, pipe 2







Image Courtesy           : http://isoc.org/wp/ietfjournal/?p=151
ipv6 training courtesy         : Tom Creighton  

hpacucli Error - Another instance of ACU is already running

Wednesday, October 6, 2010 |

Error Message

[root@blackbox locks]# hpacucli
HP Array Configuration Utility CLI 8.28-13.0
Detecting Controllers...
Error: Another instance of ACU is already running (possibly a service). Please
terminate the ACU application before running the ACU CLI. Press ENTER to
exit.
[root@blackbox locks]#
[root@blackbox ~]# ps -aef | grep acu
root 8714 8363 0 14:09 pts/0 00:00:00 grep acu
[root@blackbox ~]#
[root@blackbox ~]# ps -aef | grep hp
root 8762 8363 0 14:09 pts/0 00:00:00 grep hp
[root@blackbox ~]#


I was not able to find any other instance of the program on the process table.

Solution

1. Try to remove the lock file


[root@blackbox bbaby]# rm -f /opt/compaq/cpqacuxe/bld/locks/CPQACU_MUTEX
[root@blackbox bbaby]#



In my case this was not resolving problem. I was getting the same error message even after removing lock.

2. Do an strace and find what is blocking

[root@blackbox bbaby]# strace -f /opt/compaq/hpacucli/bld/hpacucli
execve("/opt/compaq/hpacucli/bld/hpacucli", ["/opt/compaq/hpacucli/bld/hpacucl"], [/* 19 vars */]) = 0
brk(0)
---snipped---
[pid 9629] times({tms_utime=4294967301, tms_stime=30064771073, tms_cutime=731361531114068436, tms_cstime=601725772861025720}) = 970423195
[pid 9629] time(NULL) = 1286376261
[pid 9629] time(NULL) = 1286376261
[pid 9629] stat64("/opt/compaq/cpqacuxe/bld/locks/CPQACU_MUTEX", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
[pid 9629] semget(0x1000e, 1, IPC_CREAT|0) = 7798791
[pid 9629] semop(7798791, 0x861f7c4, 2) = -1 EAGAIN (Resource temporarily unavailable)
[pid 9629] geteuid32() = 0
[pid 9629] rt_sigaction(SIGHUP, {0x1000000008094054, [], SA_RESTORER|SA_STACK|SA_RESTART|SA_INTERRUPT|SA_NODEFER|SA_RESETHAND|SA_SIGINFO|0x3943418, (nil)}, {SIG_DFL, ~[HUP INT QUIT ILL TRAP ABRT TERM URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS RTMIN RT_1 RT_2 RT_3 RT_5 RT_6 RT_8 RT_11 RT_12 RT_15 RT_16 RT_17 RT_18 RT_20 RT_22 RT_23], SA_RESTORER|SA_STACK|SA_INTERRUPT|SA_NODEFER|0x1e302d0, 0xf7f46d4c00000000}, 8) = 0
[pid 9629] rt_sigaction(SIGINT, {0x1000000008094054, [], SA_RESTORER|SA_STACK|SA_RESTART|SA_INTERRUPT|SA_NODEFER|SA_RESETHAND|SA_SIGINFO|0x3943418, (nil)}, {SIG_DFL, ~[HUP INT QUIT ILL TRAP ABRT TERM URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS RTMIN RT_1 RT_2 RT_3 RT_5 RT_6 RT_8 RT_11 RT_12 RT_15 RT_16 RT_17 RT_18 RT_20 RT_22 RT_23], SA_RESTORER|SA_STACK|SA_INTERRUPT|SA_NODEFER|0x1e302d0, 0xf7f46d4c00000000}, 8) = 0
[pid 9629] rt_sigaction(SIGQUIT, {0x1000000008094054, [], SA_RESTORER|SA_STACK|SA_RESTART|SA_INTERRUPT|SA_NODEFER|SA_RESETHAND|SA_SIGINFO|0x3943418, (nil)}, {SIG_DFL, ~[HUP INT QUIT ILL TRAP ABRT TERM URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS RTMIN RT_1 RT_2 RT_3 RT_5 RT_6 RT_8 RT_11 RT_12 RT_15 RT_16 RT_17 RT_18 RT_20 RT_22 RT_23], SA_RESTORER|SA_STACK|SA_INTERRUPT|SA_NODEFER|0x1e302d0, 0xf7f46d4c00000000}, 8) = 0
[pid 9629] rt_sigaction(SIGSEGV, {0x1000000008094054, [], SA_RESTORER|SA_STACK|SA_RESTART|SA_INTERRUPT|SA_NODEFER|SA_RESETHAND|SA_SIGINFO|0x3943418, (nil)}, {SIG_DFL, ~[HUP INT QUIT ILL TRAP ABRT TERM URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS RTMIN RT_1 RT_2 RT_3 RT_5 RT_6 RT_8 RT_11 RT_12 RT_15 RT_16 RT_17 RT_18 RT_20 RT_22 RT_23], SA_RESTORER|SA_STACK|SA_INTERRUPT|SA_NODEFER|0x1e302d0, 0xf7f46d4c00000000}, 8) = 0
[pid 9629] rt_sigaction(SIGABRT, {0x1000000008094054, [], SA_RESTORER|SA_STACK|SA_RESTART|SA_INTERRUPT|SA_NODEFER|SA_RESETHAND|SA_SIGINFO|0x3943418, (nil)}, {SIG_DFL, ~[HUP INT QUIT ILL TRAP ABRT TERM URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS RTMIN RT_1 RT_2 RT_3 RT_5 RT_6 RT_8 RT_11 RT_12 RT_15 RT_16 RT_17 RT_18 RT_20 RT_22 RT_23], SA_RESTORER|SA_STACK|SA_INTERRUPT|SA_NODEFER|0x1e302d0, 0xf7f46d4c00000000}, 8) = 0
[pid 9629] rt_sigaction(SIGFPE, {0x1000000008094054, [], SA_RESTORER|SA_STACK|SA_RESTART|SA_INTERRUPT|SA_NODEFER|SA_RESETHAND|SA_SIGINFO|0x3943418, (nil)}, {SIG_DFL, ~[HUP INT QUIT ILL TRAP ABRT TERM URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS RTMIN RT_1 RT_2 RT_3 RT_5 RT_6 RT_8 RT_11 RT_12 RT_15 RT_16 RT_17 RT_18 RT_20 RT_22 RT_23], SA_RESTORER|SA_STACK|SA_INTERRUPT|SA_NODEFER|0x1e302d0, 0xf7f46d4c00000000}, 8) = 0
[pid 9629] rt_sigaction(SIGPIPE, {0x1000000008094054, [], SA_RESTORER|SA_STACK|SA_RESTART|SA_INTERRUPT|SA_NODEFER|SA_RESETHAND|SA_SIGINFO|0x3943418, (nil)}, {SIG_DFL, ~[HUP INT QUIT ILL TRAP ABRT TERM URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS RTMIN RT_1 RT_2 RT_3 RT_5 RT_6 RT_8 RT_11 RT_12 RT_15 RT_16 RT_17 RT_18 RT_20 RT_22 RT_23], SA_RESTORER|SA_STACK|SA_INTERRUPT|SA_NODEFER|0x1e302d0, 0xf7f46d4c00000000}, 8) = 0
[pid 9629] rt_sigaction(SIGALRM, {0x1000000008094054, [], SA_RESTORER|SA_STACK|SA_RESTART|SA_INTERRUPT|SA_NODEFER|SA_RESETHAND|SA_SIGINFO|0x3943418, (nil)}, {SIG_DFL, ~[HUP INT QUIT ILL TRAP ABRT TERM URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS RTMIN RT_1 RT_2 RT_3 RT_5 RT_6 RT_8 RT_11 RT_12 RT_15 RT_16 RT_17 RT_18 RT_20 RT_22 RT_23], SA_RESTORER|SA_STACK|SA_INTERRUPT|SA_NODEFER|0x1e302d0, 0xf7f46d4c00000000}, 8) = 0
[pid 9629] rt_sigaction(SIGTERM, {0x1000000008094054, [], SA_RESTORER|SA_STACK|SA_RESTART|SA_INTERRUPT|SA_NODEFER|SA_RESETHAND|SA_SIGINFO|0x3943418, (nil)}, {SIG_DFL, ~[HUP INT QUIT ILL TRAP ABRT TERM URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS RTMIN RT_1 RT_2 RT_3 RT_5 RT_6 RT_8 RT_11 RT_12 RT_15 RT_16 RT_17 RT_18 RT_20 RT_22 RT_23], SA_RESTORER|SA_STACK|SA_INTERRUPT|SA_NODEFER|0x1e302d0, 0xf7f46d4c00000000}, 8) = 0
[pid 9629] rt_sigaction(SIGUSR1, {0x1000000008094054, [], SA_RESTORER|SA_STACK|SA_RESTART|SA_INTERRUPT|SA_NODEFER|SA_RESETHAND|SA_SIGINFO|0x3943418, (nil)}, {SIG_DFL, ~[HUP INT QUIT ILL TRAP ABRT TERM URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS RTMIN RT_1 RT_2 RT_3 RT_5 RT_6 RT_8 RT_11 RT_12 RT_15 RT_16 RT_17 RT_18 RT_20 RT_22 RT_23], SA_RESTORER|SA_STACK|SA_INTERRUPT|SA_NODEFER|0x1e302d0, 0xf7f46d4c00000000}, 8) = 0
[pid 9629] rt_sigaction(SIGUSR2, {0x1000000008094054, [], SA_RESTORER|SA_STACK|SA_RESTART|SA_INTERRUPT|SA_NODEFER|SA_RESETHAND|SA_SIGINFO|0x3943418, (nil)}, {SIG_DFL, ~[HUP INT QUIT ILL TRAP ABRT TERM URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS RTMIN RT_1 RT_2 RT_3 RT_5 RT_6 RT_8 RT_11 RT_12 RT_15 RT_16 RT_17 RT_18 RT_20 RT_22 RT_23], SA_RESTORER|SA_STACK|SA_INTERRUPT|SA_NODEFER|0x1e302d0, 0xf7f46d4c00000000}, 8) = 0
[pid 9629] rt_sigaction(SIGUSR2, {0x1000000008094054, [], SA_RESTORER|SA_STACK|SA_RESTART|SA_INTERRUPT|SA_NODEFER|SA_RESETHAND|SA_SIGINFO|0x3943418, (nil)}, {0x1000000008094054, ~[HUP INT QUIT ILL TRAP ABRT TERM URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS RTMIN RT_1 RT_2 RT_3 RT_5 RT_6 RT_8 RT_11 RT_12 RT_15 RT_16 RT_17 RT_18 RT_20 RT_22 RT_23], SA_RESTORER|SA_STACK|SA_RESTART|SA_INTERRUPT|SA_NODEFER|SA_RESETHAND|SA_SIGINFO|0x3943418, 0xf7f46d4c00000000}, 8) = 0
[pid 9629] write(1, "Detecting Controllers...\n", 25Detecting Controllers...
) = 25
[pid 9629] write(1, "\n", 1
) = 1
[pid 9629] write(1, "Error: Another instance of ACU i"..., 160Error: Another instance of ACU is already running (possibly a service). Please
terminate the ACU application before running the ACU CLI. Press ENTER to
) = 160
[pid 9629] write(1, " exit.\n", 13 exit.
) = 13
[pid 9629] write(1, "\n", 1
) = 1
[pid 9629] fstat64(0, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
[pid 9629] mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0xff942f40) = 0xfffffffff7cc8000
[pid 9629] read(0,
Process 9621 resumed
Process 9629 detached
[root@blackbox bbaby]#



In this case need to delete the semaphore *7798791*

3. Delete the blocking semaphore


{terminal}
[root@blackbox bbaby]# /usr/bin/ipcrm -s 7798791
[root@blackbox bbaby]#
{terminal}

4. Verify whether it still exits or not


[root@blackbox bbaby]# /usr/bin/ipcs -a

------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x0052e2c1 1081344 postgres 600 11083776 2

------ Semaphore Arrays --------
key semid owner perms nsems
0x0052e2c1 7569408 postgres 600 17
0x0052e2c2 7602177 postgres 600 17
0x0052e2c3 7634946 postgres 600 17
0x0052e2c4 7667715 postgres 600 17
0x0052e2c5 7700484 postgres 600 17
0x0052e2c6 7733253 postgres 600 17
0x0052e2c7 7766022 postgres 600 17
0x0001000e 7864327 root 0 1
0xffffffff 7831560 root 0 1

------ Message Queues --------
key msqid owner perms used-bytes messages

[root@blackbox bbaby]#



Check the hpacucli status


[root@blackbox bbaby]# hpacucli
HP Array Configuration Utility CLI 8.28-13.0
Detecting Controllers...Done.
Type "help" for a list of supported commands.
Type "exit" to close the console.

=> exit
[root@blackbox bbaby]#

Nagios check_mailq pluggin failing

Thursday, September 23, 2010 |

Problem:

I was trying to add mail Queue monitoring for sendmail mta with the default check_mailq plugin. check_mailq was queried using nrpe which was demonized under xinetd. Even after the basic configuration, nrpe started crying about some access related problem (nrpe checks were called by nagios user)

[root@blackbox libexec]# ./check_nrpe -H localhost -c mailq
CRITICAL: Error code 78 returned from /usr/bin/mailq
[root@blackbox libexec]#

Solution:

1. Checked nrpe.cfg and verified that the configuration is correct --> Positive

[root@blackbox libexec]# grep mailq /usr/local/nagios/etc/nrpe.cfg
command[mailq]=/usr/local/nagios/libexec/check_mailq -M sendmail -w 40 -c 50
[root@blackbox libexec]#

2. Added sudo privileges for nagios user to run /usr/bin/mailq without password

[root@blackbox libexec]# grep mailq /etc/sudoers
nagios BLACKBOX_HOSTS = (root) NOPASSWD: /usr/bin/mailq
[root@blackbox libexec]#

3. Added the missing /usr/bin/sudo command on check_mailq script from nagios pluggins package. PATH_TO_MAILQ is called from utils.pm module

[root@blackbox libexec]# grep sudo /usr/local/nagios/libexec/check_mailq
if (! open (MAILQ, "/usr/bin/sudo $utils::PATH_TO_MAILQ | " ) ) {
[root@blackbox libexec]#

Yayy!! Its working..

[root@blackbox libexec]# ./check_nrpe -H localhost -c mailq
OK: mailq is empty|unsent=0;40;50;0
[root@blackbox libexec]#

Perl time manipulation

Friday, April 16, 2010 |



Its always a challenge for any system guy to maintain application/system performance metrics for analysis and capacity planning. Harvesting the data and plotting requires lot of time related calculations. Since I am a part time programmer, cannot blabber more on perl or python's data extraction/manipulation capabilities.
Today I came across couple of modules which made my life easy while manipulating time related data using a Perl script.

i.   Date::Manip

This is a smart module which can be helpful in converting the time and date.  RPM package of this module is available from RedHat, CentOS repos.

[bbaby@basilvm ~]$ rpm -qa | grep -i manip
perl-DateManip-5.44-1.2.1
[bbaby@basilvm ~]$


Example :
 ## Get current time 
$current_time = localtime;   

 ## Take the difference between time value passed and current time
 $time_diff = DateCalc($time_value, $current_time);
##  Time difference in minutes (%s for seconds)
 $time_min = Delta_Format($time_diff, 0,'%mh');    

 Big chunk of Date::Manip examples are available here

ii.  Time::HiRes
 High resolution alarm, sleep, gettimeofday, interval timers (Examples available here )

DHCRELAY Linux

Monday, April 12, 2010 |

I am sure that many people will not get into the situation were I was in today.  The problem was simple but the fix was not under my control or reach. Had to find a work around to meet the project deadline.

Scenario:

I had to do OS installation of bunch of  brand new servers on a new VLAN.  All servers were connected under a A10 load balancer which was not supporting ip-helper (ie; I was  unable to contact the DHCP servers from the network to do a PXE boot for OS installation). On contacting A10 Load balancer team, they confirmed that their current version is not supporting ip-helper.  As the servers were on remote location, I cannot do a CD based installation and even if I get a hands and eyes support, its going to take long.  My goal was to install RHEL 5.4 from remote corporate satellite server.

Solution:

1. I had DRAC (Dell Remote Access Consoles) on all these servers. I have installed a base OS image by mounting an operating iso image through DRAC (virtual disk).  Then assigned an IP address, subnetmask, gateway on the the newly installed dummy server.
2.  Installed dhcp server rpm "dhcp-3.0.5-21.el5.x86_64.rpm" on the box. It provides dhcrelay service which can be configured as a proxy to route dhcp traffic from local network to remote DHCP server.

Then start the dhcrelay by below command: (yes you are good to go)
/usr/sbin/dhcrelay -i eth0 ip-remote-dhcp-server

 (man dhcrelay will show you full options of this command)

3. The above setting can be made permanent by adding the interface and DHCP server IP on /etc/sysconfig/dhcrelay

INTERFACES="eth0"
DHCPSERVERS="ip-of-remote-dhcp-server"

4. Start the service using

/etc/init.d/dhcrelay start


5. Make sure that the relay service is running on the host by a ps command
ps ax | grep dhcrelay

6. Rebooted the servers need to imaged from DRAC.  Press F12 to get into the PXE boot mode. Server got IP address by proxying through the DHCP relay server.

How it works:

- When the server to be installed boot up it sends a DHCP request as broadcast on the network
11:48:55.809189 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from xx:xx:xx:xx:xx:xx (oui Unknown), length: 300
- DHCP relay server running on the same network accept this broadcast
- DHCP relay server requests DHCP server on remote network for an IP address
11:48:55.809286 relay-server-IP.bootps > DHCP-IP.bootps: BOOTP/DHCP, Request from xx:xx:xx:xx:xx:xx (oui Unknown), length: 300 

- DHCP relay server did a small trick while requesting the IP by putting mac address as the MAC address of the server to be installed.
11:48:55.809286 relay-servr-IP .bootps > dhcp-server-ip.bootps: BOOTP/DHCP, Request from xx:xx:xx:xx:xx:xx (oui Unknown), length: 300

xx:xx:xx:xx:xx:xx  - MAC of server to be installed

- Rest will be like a normal DHCP request and new server will get IP lease from DHCP server.

MP3 Encoder LAME

Friday, September 4, 2009 |







I was planning a trip to Virginia beach on this long weekend. As I am traveling alone (nothing unusual.. am a lonely wanderer), music is best way to keep myself up. I had bunch of music files on my lappy, copied from Abhyant's music collection. Grrrrrr... all of these were in .wav and .aiff format. I was looking for a tool to do the conversion. Lovely tool LAME here to help me.


bbaby@luttappi:~/Songs-Abhyant/CD2$ for i in *.aiff; do j=`echo $i | sed -e 's/\.aiff/.mp3/'`; lame -b 128 -B 256 --vbr-new $i /home/bbaby/ToCD/cd2/$j;done;

I got the files in new folder. Ready to go :)

PostgreSQL Installation

Monday, August 10, 2009 |


I have started using Postgresql database from today. In my limited DB knowledge itself, I was able make out the strength of this open source DB. Unlike MySQL, its tough to get clear cut documentation about Postgres from a single source. I have installed Postgres on my devel box running on Ubuntu 9.04 (64 bit edition) . Here is the logs from my console.

1. Installation:
****************
root@luttappi:~/perl# apt-get install postgresql
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libpq5 postgresql-8.3 postgresql-client-8.3 postgresql-client-common postgresql-common
Suggested packages:
oidentd ident-server postgresql-doc-8.3
The following NEW packages will be installed:
libpq5 postgresql postgresql-8.3 postgresql-client-8.3 postgresql-client-common postgresql-common
0 upgraded, 6 newly installed, 0 to remove and 184 not upgraded.
Need to get 5245kB of archives.
After this operation, 21.4MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
<---- snipped ---------->

2. Testing the Installation:
*****************************
root@luttappi:~/perl# su - postgres
postgres@luttappi:~$ psql template1
Welcome to psql 8.3.7, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

template1=#
template1=# \l
List of databases
Name | Owner | Encoding
-----------+----------+----------
postgres | postgres | UTF8
template0 | postgres | UTF8
template1 | postgres | UTF8
(3 rows)

template1=# \q
postgres@luttappi:~$

3. New User addition
************************
root@luttappi:~/perl# useradd mayavi
root@luttappi:~/perl# passwd mayavi
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

root@luttappi:~/perl# su - postgres
postgres@luttappi:~$ psql template1
Welcome to psql 8.3.7, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

template1=# CREATE USER mayavi WITH PASSWORD 'password';
CREATE ROLE

template1=# create database kuttoosan;
CREATE DATABASE

template1=# GRANT ALL PRIVILEGES ON DATABASE kuttoosan to mayavi;
GRANT
template1=#

root@luttappi:~/perl# su - mayavi
mayavi@luttappi:~$ psql -d kuttoosan -U mayavi
Welcome to psql 8.3.7, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

kuttoosan=>


4. Installing perl db modules:
*********************************
root@luttappi:~# apt-get install libapache2-mod-perl2 apache2 libdbi-perl libdbd-pg-perl
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
apache2-mpm-worker apache2-utils apache2.2-common libapache2-reload-perl libapr1 libaprutil1 libbsd-resource-perl libdevel-symdump-perl libmysqlclient15off libnet-daemon-perl libplrpc-perl
mysql-common
Suggested packages:
apache2-doc apache2-suexec apache2-suexec-custom dbishell
The following NEW packages will be installed:
apache2 apache2-mpm-worker apache2-utils apache2.2-common libapache2-mod-perl2 libapache2-reload-perl libapr1 libaprutil1 libbsd-resource-perl libdbd-pg-perl libdbi-perl libdevel-symdump-perl
libmysqlclient15off libnet-daemon-perl libplrpc-perl mysql-common
0 upgraded, 16 newly installed, 0 to remove and 184 not upgraded.
Need to get 5719kB of archives.
After this operation, 17.4MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://us.archive.ubuntu.com jaunty-updates/main libapr1 1.2.12-5ubuntu0.1 [114kB]
Get:2 http://us.archive.ubuntu.com jaunty-updates/main mysql-common 5.1.30really5.0.75-0ubuntu10.2 [62.9kB]
Get:3 http://us.archive.ubuntu.com jaunty-updates/main libmysqlclient15off 5.1.30really5.0.75-0ubuntu10.2 [1878kB]
Get:4 http://us.archive.ubuntu.com jaunty-updates/main libaprutil1 1.2.12+dfsg-8ubuntu0.3 [79.1kB]
Get:5 http://us.archive.ubuntu.com jaunty-updates/main apache2-utils 2.2.11-2ubuntu2.2 [151kB]
Get:6 http://us.archive.ubuntu.com jaunty-updates/main apache2.2-common 2.2.11-2ubuntu2.2 [827kB]
Get:7 http://us.archive.ubuntu.com jaunty-updates/main apache2-mpm-worker 2.2.11-2ubuntu2.2 [258kB]
Get:8 http://us.archive.ubuntu.com jaunty-updates/main apache2 2.2.11-2ubuntu2.2 [46.3kB]
Get:9 http://us.archive.ubuntu.com jaunty/main libdevel-symdump-perl 2.08-1 [16.4kB]
Get:10 http://us.archive.ubuntu.com jaunty/main libapache2-mod-perl2 2.0.4-5ubuntu1 [1147kB]
Get:11 http://us.archive.ubuntu.com jaunty/main libapache2-reload-perl 0.10-2 [19.9kB]
Get:12 http://us.archive.ubuntu.com jaunty/main libnet-daemon-perl 0.43-1 [46.9kB]
Get:13 http://us.archive.ubuntu.com jaunty/main libplrpc-perl 0.2020-1 [36.0kB]
Get:14 http://us.archive.ubuntu.com jaunty/main libdbi-perl 1.607-1 [793kB]
Get:15 http://us.archive.ubuntu.com jaunty/universe libdbd-pg-perl 2.11.7-1 [212kB]
Get:16 http://us.archive.ubuntu.com jaunty/main libbsd-resource-perl 1.2901-1 [31.8kB]
Fetched 5719kB in 10s (523kB/s)
Selecting previously deselected package libapr1.
(Reading database ... 103255 files and directories currently installed.)
Unpacking libapr1 (from .../libapr1_1.2.12-5ubuntu0.1_amd64.deb) ...
Selecting previously deselected package mysql-common.
Unpacking mysql-common (from .../mysql-common_5.1.30really5.0.75-0ubuntu10.2_all.deb) ...
Selecting previously deselected package libmysqlclient15off.
Unpacking libmysqlclient15off (from .../libmysqlclient15off_5.1.30really5.0.75-0ubuntu10.2_amd64.deb) ...
Selecting previously deselected package libaprutil1.
Unpacking libaprutil1 (from .../libaprutil1_1.2.12+dfsg-8ubuntu0.3_amd64.deb) ...
Selecting previously deselected package apache2-utils.
Unpacking apache2-utils (from .../apache2-utils_2.2.11-2ubuntu2.2_amd64.deb) ...
Selecting previously deselected package apache2.2-common.
Unpacking apache2.2-common (from .../apache2.2-common_2.2.11-2ubuntu2.2_amd64.deb) ...
Selecting previously deselected package apache2-mpm-worker.
Unpacking apache2-mpm-worker (from .../apache2-mpm-worker_2.2.11-2ubuntu2.2_amd64.deb) ...
Selecting previously deselected package apache2.
Unpacking apache2 (from .../apache2_2.2.11-2ubuntu2.2_all.deb) ...
Selecting previously deselected package libdevel-symdump-perl.
Unpacking libdevel-symdump-perl (from .../libdevel-symdump-perl_2.08-1_all.deb) ...
Selecting previously deselected package libapache2-mod-perl2.
Unpacking libapache2-mod-perl2 (from .../libapache2-mod-perl2_2.0.4-5ubuntu1_amd64.deb) ...
Selecting previously deselected package libapache2-reload-perl.
Unpacking libapache2-reload-perl (from .../libapache2-reload-perl_0.10-2_all.deb) ...
Selecting previously deselected package libnet-daemon-perl.
Unpacking libnet-daemon-perl (from .../libnet-daemon-perl_0.43-1_all.deb) ...
Selecting previously deselected package libplrpc-perl.
Unpacking libplrpc-perl (from .../libplrpc-perl_0.2020-1_all.deb) ...
Selecting previously deselected package libdbi-perl.
Unpacking libdbi-perl (from .../libdbi-perl_1.607-1_amd64.deb) ...
Selecting previously deselected package libdbd-pg-perl.
Unpacking libdbd-pg-perl (from .../libdbd-pg-perl_2.11.7-1_amd64.deb) ...
Selecting previously deselected package libbsd-resource-perl.
Unpacking libbsd-resource-perl (from .../libbsd-resource-perl_1.2901-1_amd64.deb) ...
Processing triggers for man-db ...
Processing triggers for ufw ...
Setting up libapr1 (1.2.12-5ubuntu0.1) ...

Setting up mysql-common (5.1.30really5.0.75-0ubuntu10.2) ...
Setting up libmysqlclient15off (5.1.30really5.0.75-0ubuntu10.2) ...

Setting up libaprutil1 (1.2.12+dfsg-8ubuntu0.3) ...

Setting up apache2-utils (2.2.11-2ubuntu2.2) ...
Setting up apache2.2-common (2.2.11-2ubuntu2.2) ...
Enabling site default.
Enabling module alias.
Enabling module autoindex.
Enabling module dir.
Enabling module env.
Enabling module mime.
Enabling module negotiation.
Enabling module setenvif.
Enabling module status.
Enabling module auth_basic.
Enabling module deflate.
Enabling module authz_default.
Enabling module authz_user.
Enabling module authz_groupfile.
Enabling module authn_file.
Enabling module authz_host.

Setting up apache2-mpm-worker (2.2.11-2ubuntu2.2) ...
* Starting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
...done.

Setting up apache2 (2.2.11-2ubuntu2.2) ...
Setting up libdevel-symdump-perl (2.08-1) ...
Setting up libapache2-mod-perl2 (2.0.4-5ubuntu1) ...
Enabling module perl.
Run '/etc/init.d/apache2 restart' to activate new configuration!

Setting up libapache2-reload-perl (0.10-2) ...
Setting up libnet-daemon-perl (0.43-1) ...
Setting up libplrpc-perl (0.2020-1) ...
Setting up libdbi-perl (1.607-1) ...
Setting up libdbd-pg-perl (2.11.7-1) ...
Setting up libbsd-resource-perl (1.2901-1) ...
Processing triggers for libc6 ...
ldconfig deferred processing now taking place
root@luttappi:~#


5. Web based administration - PhpPgAdmin
***********************************************
root@luttappi:~# apt-get install phppgadmin
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
apache2-mpm-prefork libapache2-mod-php5 php5-common php5-pgsql postgresql-doc postgresql-doc-8.3
Suggested packages:
php-pear slony1-bin
The following packages will be REMOVED:
apache2-mpm-worker
The following NEW packages will be installed:
apache2-mpm-prefork libapache2-mod-php5 php5-common php5-pgsql phppgadmin postgresql-doc postgresql-doc-8.3
0 upgraded, 7 newly installed, 1 to remove and 184 not upgraded.
Need to get 6157kB of archives.
After this operation, 24.1MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://us.archive.ubuntu.com jaunty-updates/main apache2-mpm-prefork 2.2.11-2ubuntu2.2 [253kB]
Get:2 http://us.archive.ubuntu.com jaunty-updates/main php5-common 5.2.6.dfsg.1-3ubuntu4.1 [372kB]
Get:3 http://us.archive.ubuntu.com jaunty-updates/main libapache2-mod-php5 5.2.6.dfsg.1-3ubuntu4.1 [2615kB]
Get:4 http://us.archive.ubuntu.com jaunty-updates/main php5-pgsql 5.2.6.dfsg.1-3ubuntu4.1 [57.8kB]
Get:5 http://us.archive.ubuntu.com jaunty/main postgresql-doc-8.3 8.3.7-1 [1963kB]
Get:6 http://us.archive.ubuntu.com jaunty/main postgresql-doc 8.3.7-1 [3408B]
Get:7 http://us.archive.ubuntu.com jaunty/universe phppgadmin 4.2.2-1 [894kB]
Fetched 6157kB in 13s (463kB/s)
dpkg: apache2-mpm-worker: dependency problems, but removing anyway as you request:
apache2 depends on apache2-mpm-worker (>= 2.2.11-2ubuntu2.2) | apache2-mpm-prefork (>= 2.2.11-2ubuntu2.2) | apache2-mpm-event (>= 2.2.11-2ubuntu2.2); however:
Package apache2-mpm-worker is to be removed.
Package apache2-mpm-prefork is not installed.
Package apache2-mpm-event is not installed.
(Reading database ... 104442 files and directories currently installed.)
Removing apache2-mpm-worker ...
* Stopping web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
... waiting ...done.
Selecting previously deselected package apache2-mpm-prefork.
(Reading database ... 104434 files and directories currently installed.)
Unpacking apache2-mpm-prefork (from .../apache2-mpm-prefork_2.2.11-2ubuntu2.2_amd64.deb) ...
Selecting previously deselected package php5-common.
Unpacking php5-common (from .../php5-common_5.2.6.dfsg.1-3ubuntu4.1_amd64.deb) ...
Selecting previously deselected package libapache2-mod-php5.
Unpacking libapache2-mod-php5 (from .../libapache2-mod-php5_5.2.6.dfsg.1-3ubuntu4.1_amd64.deb) ...
Selecting previously deselected package php5-pgsql.
Unpacking php5-pgsql (from .../php5-pgsql_5.2.6.dfsg.1-3ubuntu4.1_amd64.deb) ...
Selecting previously deselected package postgresql-doc-8.3.
Unpacking postgresql-doc-8.3 (from .../postgresql-doc-8.3_8.3.7-1_all.deb) ...
Selecting previously deselected package postgresql-doc.
Unpacking postgresql-doc (from .../postgresql-doc_8.3.7-1_all.deb) ...
Selecting previously deselected package phppgadmin.
Unpacking phppgadmin (from .../phppgadmin_4.2.2-1_all.deb) ...
Processing triggers for doc-base ...
Processing 23 changed, 1 added doc-base file(s)...
Registering documents with scrollkeeper...
Setting up apache2-mpm-prefork (2.2.11-2ubuntu2.2) ...
* Starting web server apache2
apache2: Syntax error on line 278 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/conf.d/phppgadmin: No such file or directory
...fail!
invoke-rc.d: initscript apache2, action "start" failed.

Setting up php5-common (5.2.6.dfsg.1-3ubuntu4.1) ...
Setting up libapache2-mod-php5 (5.2.6.dfsg.1-3ubuntu4.1) ...

Creating config file /etc/php5/apache2/php.ini with new version
Your apache2 configuration is broken, so we're not restarting it for you.

Setting up php5-pgsql (5.2.6.dfsg.1-3ubuntu4.1) ...

Setting up postgresql-doc-8.3 (8.3.7-1) ...

Setting up postgresql-doc (8.3.7-1) ...
Setting up phppgadmin (4.2.2-1) ...
* Reloading web server config apache2
root@luttappi:~#

6. PhpPgAdmin configuration file:
**************************************

root@luttappi:/usr/share/phppgadmin/conf# pwd
/usr/share/phppgadmin/conf
root@luttappi:/usr/share/phppgadmin/conf# ls -l config.inc.php
lrwxrwxrwx 1 root root 30 2009-08-10 13:24 config.inc.php -> /etc/phppgadmin/config.inc.php
root@luttappi:/usr/share/phppgadmin/conf#

7. Access:
************
http://localhost/phppgadmin

Menu Based - Time changing Script

Tuesday, July 7, 2009 |

I was working with few testers who need to change the system time occasionally on a linux box. Most of the time, they had problem while issuing the date command. Below one is a menu based shell script to update time on a linux box (xen guest in this case)

#!/bin/bash

Author : basil@
Purpose : Menu based date/time change of Linux boxes with ntpdate
Date : 04-20-2009

# Below kernel parameter is to allow xen guest take independent decision about its clock.

echo 1 > /proc/sys/xen/independent_wallclock

while :
do
clear
echo "-------------------------------------"
echo " Main Menu "
echo "-------------------------------------"
echo "[1] Show Todays date/time"
echo "[2] Change System time"
echo "[3] Show calendar"
echo "[4] Change System time to Current time"
echo "[5] Exit/Stop"
echo "======================="
echo -n "Enter your menu choice [1-5]: "
read yourch

case $yourch in
1) echo "Today is `date` , press Enter/Return key. . ." ; read ;;
2) echo "Enter new date and time [Format: MMDDHHMMYYYY]: ";read newtime ; date $newtime;echo "Today is `date`, , press Enter/Return key. . ." ; read ;;
3) /usr/bin/cal; echo "Press a key. . ." ; read ;;
4) echo "Updating to Current time..."; `/usr/sbin/ntpdate -s clock.redhat.com`;echo "Today is `date`, , press Enter/Return key. . ." ; read ;;
5) exit 0 ;;
*) echo "Opps!!! Please select choice 1,2,3 or 4";
echo "Press Enter/Return key. . ." ; read ;;

esac
done

Time Sync issues - VMware Guest Hosts

Monday, July 6, 2009 |




I was damn tired of time sync issues related to guest hosts running on top of VMware ESX 3.5 host. Even though I have installed ntp client on all the servers, but still the guest OS's are running out of Sync.





NTP Recommendations

Note: In all cases use NTP instead of VMware Tools periodic time synchronization. Also, you may need to open the firewall (UPD 123) to allow NTP traffic.
The following is a sample /etc/ntp.conf :
tinker panic 0
restrict 127.0.0.1
restrict default kod nomodify notrap
server 0.vmware.pool.ntp.org
server 1.vmware.pool.ntp.org
server 2.vmware.pool.ntp.org
driftfile /var/lib/ntp/drift
The following is a sample /etc/ntp/step-tickers :
0.vmware.pool.ntp.org
1.vmware.pool.ntp.org
The configuration directive tinker panic 0 instructs NTP not to give up if it sees a large jump in time. This is important for coping with large time drifts and also resuming virtual machines from their suspended state.
Note: The directive tinker panic 0 must be at the top of the ntp.conf file.
It is also important not to use the local clock as a time source, often referred to as the Undisciplined Local Clock. NTP has a tendency to fall back to this in preference to the remote servers when there is a large amount of time drift.
An example of such a configuration is:
server 127.127.1.0
fudge 127.127.1.0 stratum 10
Comment out both lines.
After making changes to NTP configuration, the NTP daemon must be restarted. Refer to your operating system vendor’s documentation.

VMware Tools time synchronization configuration

When using NTP in the guest, disable VMware Tools periodic time synchronization.
To disable VMware Tools periodic time sync you use one of the following options:
  1. Set tools.syncTime = "0" in the configuration file (.vmx file) of the virtual machine.

    OR

  2. Deselect Time synchronization between the virtual machine and the host operating system in the VMware Tools toolbox GUI of the guest operating system.

    OR

  3. Run the vmware-guestd --cmd "vmx.set_option synctime 1 0" command in the guest operating system.
These options do not disable one-time synchronizations done by VMware Tools for events such as tools startup, taking a snapshot, resuming from a snapshot, resuming from suspend, or VMotion. These events synchronize time in the guest operating system with time in the host operating system, so it is important to make sure that the host operating system's time is correct.
To do this for VMware ACE, VMware Fusion, VMware GSX Server, VMware Player, VMware Server, and VMware Workstation run time synchronization software such as NTP or w32time in the host. For VMware ESX run NTP in the service console. For VMware ESXi, run NTP in the VMkernel.

Virtual Hardware clock configuration

When configuring the Linux guest operating system, if you are given a choice between keeping the “hardware” clock (that is, the virtual CMOS time of day clock) in UTC or local time, choose UTC. This avoids any confusion when your local time changes between standard and daylight saving time (in England, "summer time").


64bit Kernels

Linux Flavor
Version
Kernel Parameters
Notes
RHEL

RHEL 5.3 notsc divider=10
RHEL 5.2
notsc divider=10
RHEL 5.1 with RHSA-2007:0993-13
notsc divider=10
RHEL 5.1 without RHSA-2007:0993-13
notsc


32bit Kernels

Linux Flavor Version Kernel Parameters Notes
RHEL



RHEL 5.3 divider=10 clocksource=acpi_pm

RHEL 5.2 divider=10 clocksource=acpi_pm

RHEL 5.1 divider=10 clocksource=acpi_pm

RHEL 5.0 clocksource=acpi_pm

Editing Kernel Configuration

Kernel command line parameters are specified in the /etc/lilo.conf or /boot/grub/grub.conf file, depending on your choice of boot loader.

For LILO, put the kernel command line parameters at the end of the "append" line. For example, if the append line looks like:

append="resume=/dev/hda6 splash=silent"

and you want to add "clock=pmtmr divider=10" the updated text is:

append="resume=/dev/hda6 splash=silent clock=pmtmr divider=10"

Remember to run /sbin/lilo after editing lilo.conf , so that your edits take effect.

For GRUB, put the kernel command line parameters at the end of the "kernel" line. For example if the kernel line looks like:

kernel /vmlinuz-2.6.18 ro root=/dev/hda2

and you want to add "clock=pmtmr divider=10" the updated text is:

kernel /vmlinuz-2.6.18 ro root=/dev/hda2 clock=pmtmr divider=10


Below given is the best practice, for time related issues on VMware guests.

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1006427

TCP - CONNECTION

Wednesday, June 17, 2009 |

Connection State Definition:
----------------------------------

ESTABLISHED – both hosts are connected
CLOSING – the remote host is closing the connection
LISTENING – the host is listening for incoming connections
SYN_RCVD – a remote host has asked to start a connection
SYN_SENT – the host is starting a new connection
LAST_ACK – the host must send a report before closing the connection
TIMED_WAIT, CLOSE_WAIT – a remote host is terminating the connection
FIN_WAIT 1 – the client is terminating the connection
FIN_WAIT 2 – both hosts are closing the connection

TCP cutter : http://www.cyberciti.biz/tips/cutting-the-tcpip-network-connection-with-cutter.html
TCPKILL : http://www.cyberciti.biz/howto/question/linux/kill-tcp-connection-using-linux-netstat.php

Parameters which can be configured on Kernel:
-----------------------------------------------------------

From the link :http://www.cs.uwaterloo.ca/~brecht/servers/ip-sysctl.txt

/proc/sys/net/ipv4/* Variables:

ip_forward - BOOLEAN
0 - disabled (default)
not 0 - enabled

Forward Packets between interfaces.

This variable is special, its change resets all configuration
parameters to their default state (RFC1122 for hosts, RFC1812
for routers)

ip_default_ttl - INTEGER
default 64

ip_no_pmtu_disc - BOOLEAN
Disable Path MTU Discovery.
default FALSE

IP Fragmentation:

ipfrag_high_thresh - INTEGER
Maximum memory used to reassemble IP fragments. When
ipfrag_high_thresh bytes of memory is allocated for this purpose,
the fragment handler will toss packets until ipfrag_low_thresh
is reached.

ipfrag_low_thresh - INTEGER
See ipfrag_high_thresh

ipfrag_time - INTEGER
Time in seconds to keep an IP fragment in memory.

INET peer storage:

inet_peer_threshold - INTEGER
The approximate size of the storage. Starting from this threshold
entries will be thrown aggressively. This threshold also determines
entries' time-to-live and time intervals between garbage collection
passes. More entries, less time-to-live, less GC interval.

inet_peer_minttl - INTEGER
Minimum time-to-live of entries. Should be enough to cover fragment
time-to-live on the reassembling side. This minimum time-to-live is
guaranteed if the pool size is less than inet_peer_threshold.
Measured in jiffies.

inet_peer_maxttl - INTEGER
Maximum time-to-live of entries. Unused entries will expire after
this period of time if there is no memory pressure on the pool (i.e.
when the number of entries in the pool is very small).
Measured in jiffies.

inet_peer_gc_mintime - INTEGER
Minimum interval between garbage collection passes. This interval is
in effect under high memory pressure on the pool.
Measured in jiffies.

inet_peer_gc_maxtime - INTEGER
Minimum interval between garbage collection passes. This interval is
in effect under low (or absent) memory pressure on the pool.
Measured in jiffies.

TCP variables:

tcp_syn_retries - INTEGER
Number of times initial SYNs for an active TCP connection attempt
will be retransmitted. Should not be higher than 255. Default value
is 5, which corresponds to ~180seconds.

tcp_synack_retries - INTEGER
Number of times SYNACKs for a passive TCP connection attempt will
be retransmitted. Should not be higher than 255. Default value
is 5, which corresponds to ~180seconds.

tcp_keepalive_time - INTEGER
How often TCP sends out keepalive messages when keepalive is enabled.
Default: 2hours.

tcp_keepalive_probes - INTEGER
How many keepalive probes TCP sends out, until it decides that the
connection is broken. Default value: 9.

tcp_keepalive_interval - INTEGER
How frequently the probes are send out. Multiplied by
tcp_keepalive_probes it is time to kill not responding connection,
after probes started. Default value: 75sec i.e. connection
will be aborted after ~11 minutes of retries.

tcp_retries1 - INTEGER
How many times to retry before deciding that something is wrong
and it is necessary to report this suspection to network layer.
Minimal RFC value is 3, it is default, which corresponds
to ~3sec-8min depending on RTO.

tcp_retries2 - INTEGER
How may times to retry before killing alive TCP connection.
RFC1122 says that the limit should be longer than 100 sec.
It is too small number. Default value 15 corresponds to ~13-30min
depending on RTO.

tcp_orphan_retries - INTEGER
How may times to retry before killing TCP connection, closed
by our side. Default value 7 corresponds to ~50sec-16min
depending on RTO. If you machine is loaded WEB server,
you should think about lowering this value, such sockets
may consume significant resources. Cf. tcp_max_orphans.

tcp_fin_timeout - INTEGER
Time to hold socket in state FIN-WAIT-2, if it was closed
by our side. Peer can be broken and never close its side,
or even died unexpectedly. Default value is 60sec.
Usual value used in 2.2 was 180 seconds, you may restore
it, but remember that if your machine is even underloaded WEB server,
you risk to overflow memory with kilotons of dead sockets,
FIN-WAIT-2 sockets are less dangerous than FIN-WAIT-1,
because they eat maximum 1.5K of memory, but they tend
to live longer. Cf. tcp_max_orphans.

tcp_max_tw_buckets - INTEGER
Maximal number of timewait sockets held by system simultaneously.
If this number is exceeded time-wait socket is immediately destroyed
and warning is printed. This limit exists only to prevent
simple DoS attacks, you _must_ not lower the limit artificially,
but rather increase it (probably, after increasing installed memory),
if network conditions require more than default value.

tcp_tw_recycle - BOOLEAN
Enable fast recycling TIME-WAIT sockets. Default value is 1.
It should not be changed without advice/request of technical
experts.

tcp_max_orphans - INTEGER
Maximal number of TCP sockets not attached to any user file handle,
held by system. If this number is exceeded orphaned connections are
reset immediately and warning is printed. This limit exists
only to prevent simple DoS attacks, you _must_ not rely on this
or lower the limit artificially, but rather increase it
(probably, after increasing installed memory),
if network conditions require more than default value,
and tune network services to linger and kill such states
more aggressively. Let me to remind again: each orphan eats
up to ~64K of unswappable memory.

tcp_abort_on_overflow - BOOLEAN
If listening service is too slow to accept new connections,
reset them. Default state is FALSE. It means that if overflow
occurred due to a burst, connection will recover. Enable this
option _only_ if you are really sure that listening daemon
cannot be tuned to accept connections faster. Enabling this
option can harm clients of your server.

tcp_syncookies - BOOLEAN
Only valid when the kernel was compiled with CONFIG_SYNCOOKIES
Send out syncookies when the syn backlog queue of a socket
overflows. This is to prevent against the common 'syn flood attack'
Default: FALSE

Note, that syncookies is fallback facility.
It MUST NOT be used to help highly loaded servers to stand
against legal connection rate. If you see synflood warnings
in your logs, but investigation shows that they occur
because of overload with legal connections, you should tune
another parameters until this warning disappear.
See: tcp_max_syn_backlog, tcp_synack_retries, tcp_abort_on_overflow.

syncookies seriously violate TCP protocol, do not allow
to use TCP extensions, can result in serious degradation
of some services (f.e. SMTP relaying), visible not by you,
but your clients and relays, contacting you. While you see
synflood warnings in logs not being really flooded, your server
is seriously misconfigured.

tcp_stdurg - BOOLEAN
Use the Host requirements interpretation of the TCP urg pointer field.
Most hosts use the older BSD interpretation, so if you turn this on
Linux might not communicate correctly with them.
Default: FALSE

tcp_max_syn_backlog - INTEGER
Maximal number of remembered connection requests, which are
still did not receive an acknowledgement from connecting client.
Default value is 1024 for systems with more than 128Mb of memory,
and 128 for low memory machines. If server suffers of overload,
try to increase this number. Warning! If you make it greater
than 1024, it would be better to change TCP_SYNQ_HSIZE in
include/net/tcp.h to keep TCP_SYNQ_HSIZE*16<=tcp_max_syn_backlog
and to recompile kernel.

tcp_window_scaling - BOOLEAN
Enable window scaling as defined in RFC1323.

tcp_timestamps - BOOLEAN
Enable timestamps as defined in RFC1323.

tcp_sack - BOOLEAN
Enable select acknowledgments (SACKS).

tcp_fack - BOOLEAN
Enable FACK congestion avoidance and fast restransmission.
The value is not used, if tcp_sack is not enabled.

tcp_dsack - BOOLEAN
Allows TCP to send "duplicate" SACKs.

tcp_ecn - BOOLEAN
Enable Explicit Congestion Notification in TCP.

tcp_reordering - INTEGER
Maximal reordering of packets in a TCP stream.
Default: 3

tcp_retrans_collapse - BOOLEAN
Bug-to-bug compatibility with some broken printers.
On retransmit try to send bigger packets to work around bugs in
certain TCP stacks.

tcp_wmem - vector of 3 INTEGERs: min, default, max
min: Amount of memory reserved for send buffers for TCP socket.
Each TCP socket has rights to use it due to fact of its birth.
Default: 4K

default: Amount of memory allowed for send buffers for TCP socket
by default. This value overrides net.core.wmem_default used
by other protocols, it is usually lower than net.core.wmem_default.
Default: 16K

max: Maximal amount of memory allowed for automatically selected
send buffers for TCP socket. This value does not override
net.core.wmem_max, "static" selection via SO_SNDBUF does not use this.
Default: 128K

tcp_rmem - vector of 3 INTEGERs: min, default, max
min: Minimal size of receive buffer used by TCP sockets.
It is guaranteed to each TCP socket, even under moderate memory
pressure.
Default: 8K

default: default size of receive buffer used by TCP sockets.
This value overrides net.core.rmem_default used by other protocols.
Default: 87380 bytes. This value results in window of 65535 with
default setting of tcp_adv_win_scale and tcp_app_win:0 and a bit
less for default tcp_app_win. See below about these variables.

max: maximal size of receive buffer allowed for automatically
selected receiver buffers for TCP socket. This value does not override
net.core.rmem_max, "static" selection via SO_RCVBUF does not use this.
Default: 87380*2 bytes.

tcp_mem - vector of 3 INTEGERs: min, pressure, max
low: below this number of pages TCP is not bothered about its
memory appetite.

pressure: when amount of memory allocated by TCP exceeds this number
of pages, TCP moderates its memory consumption and enters memory
pressure mode, which is exited when memory consumtion falls
under "low".

high: number of pages allowed for queueing by all TCP sockets.

Defaults are calculated at boot time from amount of available
memory.

tcp_app_win - INTEGER
Reserve max(window/2^tcp_app_win, mss) of window for application
buffer. Value 0 is special, it means that nothing is reserved.
Default: 31

tcp_adv_win_scale - INTEGER
Count buffering overhead as bytes/2^tcp_adv_win_scale
(if tcp_adv_win_scale > 0) or bytes-bytes/2^(-tcp_adv_win_scale),
if it is <= 0.
Default: 2

ip_local_port_range - 2 INTEGERS
Defines the local port range that is used by TCP and UDP to
choose the local port. The first number is the first, the
second the last local port number. Default value depends on
amount of memory available on the system:
> 128Mb 32768-61000
< 128Mb 1024-4999 or even less.
This number defines number of active connections, which this
system can issue simultaneously to systems not supporting
TCP extensions (timestamps). With tcp_tw_recycle enabled
(i.e. by default) range 1024-4999 is enough to issue up to
2000 connections per second to systems supporting timestamps.

icmp_echo_ignore_all - BOOLEAN
icmp_echo_ignore_broadcasts - BOOLEAN
If either is set to true, then the kernel will ignore either all
ICMP ECHO requests sent to it or just those to broadcast/multicast
addresses, respectively.

icmp_destunreach_rate - INTEGER
icmp_paramprob_rate - INTEGER
icmp_timeexceed_rate - INTEGER
icmp_echoreply_rate - INTEGER (not enabled per default)
Limit the maximal rates for sending ICMP packets to specific targets.
0 to disable any limiting, otherwise the maximal rate in jiffies(1)
See the source for more information.

icmp_ignore_bogus_error_responses - BOOLEAN
Some routers violate RFC 1122 by sending bogus responses to broadcast
frames. Such violations are normally logged via a kernel warning.
If this is set to TRUE, the kernel will not give such warnings, which
will avoid log file clutter.
Default: FALSE

(1) Jiffie: internal timeunit for the kernel. On the i386 1/100s, on the
Alpha 1/1024s. See the HZ define in /usr/include/asm/param.h for the exact
value on your system.

conf/interface/*:
conf/all/* is special and changes the settings for all interfaces.
Change special settings per interface.

log_martians - BOOLEAN
Log packets with impossible addresses to kernel log.

accept_redirects - BOOLEAN
Accept ICMP redirect messages.
default TRUE (host)
FALSE (router)

forwarding - BOOLEAN
Enable IP forwarding on this interface.

mc_forwarding - BOOLEAN
Do multicast routing. The kernel needs to be compiled with CONFIG_MROUTE
and a multicast routing daemon is required.

proxy_arp - BOOLEAN
Do proxy arp.

shared_media - BOOLEAN
Send(router) or accept(host) RFC1620 shared media redirects.
Overrides ip_secure_redirects.
default TRUE

secure_redirects - BOOLEAN
Accept ICMP redirect messages only for gateways,
listed in default gateway list.
default TRUE

send_redirects - BOOLEAN
Send redirects, if router. Default: TRUE

bootp_relay - BOOLEAN
Accept packets with source address 0.b.c.d destined
not to this host as local ones. It is supposed, that
BOOTP relay daemon will catch and forward such packets.

default FALSE
Not Implemented Yet.

accept_source_route - BOOLEAN
Accept packets with SRR option.
default TRUE (router)
FALSE (host)

rp_filter - BOOLEAN
1 - do source validation by reversed path, as specified in RFC1812
Recommended option for single homed hosts and stub network
routers. Could cause troubles for complicated (not loop free)
networks running a slow unreliable protocol (sort of RIP),
or using static routes.

0 - No source validation.

Default value is 0. Note that some distributions enable it
in startip scripts.