Thursday, April 3, 2014

How to check ntp version + redhat linux

Hi Friends,

Same as HP UNIX, ntp version can be checked from ntpq prompt. Please go to ntpq prompt, write version there, it will give the output which you are using.

attaching screen shot.






Love Sharing
Amit Chopra



Wednesday, April 2, 2014

How to check version of NTP + Hp UX

Hello Friends,

We were looking for NTP version installed on the hp ux server. but couldn't get the information using swinstall, swlist -l product, swlist -l fileset, swlist -l patch, swagent.log. After trying so many things we checked in

#ntpq
ntpq"prompt'
ntpq"prompt" version
"it will show the installed version of NTP"

NTP prompt is ntp"greater than arrow sign", {I dont know how can i enable the arrow signs here, as greater than or smaller than sign changes into some code after clicking on publish of post}
. Sorry for the inconvenience.

1. Somewhere i read on google, that "ntpd -v" will show the version of NTP. Or /usr/sbin/ntpd -v or /usr/sbin/xntpd -v will show the version but this was not available on  V3 and V2.

2. Also the /etc/rc.config.d/netdaemon files and /etc/ntp.conf  do not carry exact information about the version of NTP.

3. yes also Read on HP forum that the by default version of NTP which comes with 11.31 V3 is NTP verison 3.5.

4. The latest release from HP is version 4.2.6, not yet recommended by HP to upgrade the version.

5. Now to automate and check the version on large number of server, we can use a script or command. like below :-

If you are using any tool to get all information from all server from one server then it is very fine. you can use below command and extract information from the same.

 #"hostname; echo 'version' |ntpq; echo 'ntpversion' |ntpq"

or

#echo 'version' |ntpq

it will show the output, you not need to  give an input manually to ntpq prompt. after this you can redirect the output to some file also.

6. echo 'version' is giving its output to ntpq prompt and using this we can get the version of NTP.


Love Sharing
Amit Chopra


Tuesday, April 1, 2014

wtmpx data file Huge size + solaris

Hi Friends,

/var/adm/wtmpx  is a file, which keeps login details of the users and also carries shutdown, reboot of the server details. We faced File system full issue due to it. Our File system was total of size 15 GB, and the wtmpx file was occupying 12 GB of space and there were some other files which were occupying few spaces in MBs.

 and we were also not having space on other LVs, so that we could move the wtmp file and then compress the same. We could not stop the wtmp file logging.

a. We copied the same in text format using below command on /temp.

#/usr/lib/acct/fwtmp "<" /var/adm/wtmpx ">" /temp/wtmp.txt (the first sign used is "less than" and the second sign used is "greater than". First one is used to read the content and second one is used to to fwd the content of wtmpx file to text file )

We can also use the last -f command to read the files utmp, wtmp, btmp. As these file types are data type so should not be read with vi, more, cat.
#
#last -f /var/adm/wtmp or
#last -f /var/log/wtmp


this copied the content of wtmp file in /temp/wtmp.txt. You can name this file as per your wish.

this wtmp.txt file size was around 4.8G as it copied all the content of wtmp file of 12 GB.

b. We can monitor the /temp File system and we can also tail -f /temp/wtmp.txt file to check whether the files is proper or not. Now we can read the file as well.

c. tar/ compress/gzip the file, I gzipped the file

#gzip /temp/wtmp.txt

the size of above file became 250MB approx.

d. Now truncate the /var/adm/wtmp file or pass null value to the same like

#> /var/adm/wtmp :- this doesnt kill the process, but it empties the file.

e. File system size reduced.

f. Now moved the wtmp.txt file back to /var/adm/


It was a good learning. the FS size reduced and /var was available for use.




Love Sharing
Amit Chopra




#

Sunday, March 23, 2014

Corrupt inittab + HP UX

Hi Friends,

We faced an issue of "corrupt inittab" after five times reboot of machine HP UNIX due to some Hardware issue. Got an opportunity to work with a Senior.

Error :- "Corrupt inittab"

 With this error,
we first thought that do we have an Ignite backup on tape or not,
Second we though can there be an option if we can restore the inittab from other system and use of the same,
Third we thought of checking from point that if our one disk out of mirror is corrupt or if we need to mirror the same.
Fourth :- If we can boot the machine in single user mode.
Fifth :- If we can boot the machine in LVM maintenance mode in hp ux from hpux prompt using "boot vmunix -lm"
and boot the machine.
a. here after boot up in hpux lvm {lvm maintenance mode}, coming to # prompt.Obviously the experience worked.
He copied the inittab file from /usr/newconfig/etc/inittab to /etc/inittab.
b. we were able to copy the first inittab of the server and then copy it on the /etc/inittab.
c. We reboot the system and checked it worked.
d. after reboot, the vgdisplay command showed correct o/p. we checked the same with previous getsysinfo o/p we had in our /tmp location.
e. checked lvdisplay -v "every root lv".
f. this showed stale devices on root lv on one mirrored disk.
g. here we ran, lvsync /dev/vg00/lvol3
h. it started syncing all stale path hanged into current after some time.
i. we took a reboot to confirm and system came up properly. we compared previous outputs and files. they were fine. we restored some part also with latest backup with us.

It was good learning experience, i wish if i can learn more each day.


Love Sharing
Amit Chopra


Friday, March 21, 2014

Linux System working slow after boot up

Hi Friends,

My Linux box is showing %IO wait 50, when i boot it up. But at the same time, when i take a reboot of it, the % IO wait becomes zero and CPU runs fine.

What all can be the issues? please suggest.


Love Sharing
Amit Chopra