Posts Tagged admin

Physical memory in AIX

To check the amount of physical RAM that a AIX Server has, you can use the following commands:

lsattr -El sys0 | grep realmem
realmem 16121856 Amount of usable physical memory in Kbytes

or

lsattr -El mem0
goodsize 15744 Amount of usable physical memory in Mbytes False
size 15744 Total amount of physical memory in Mbytes False

or

prtconf|grep "Memory Size"
Memory Size: 15744 MB
Good Memory Size: 15744 MB

, ,

No Comments

Glance shortcuts

To use the buttons at the bottom of the glance, you should do an "export TERM=dtterm".

After that, you will be able to use:
F1 for ProcList
F2 for CPU Rpt
F3 for Mem Rpt
F4 for Disk Rpt
F5 for NextKeys
F6 for SlctProc
F7 for Help
F8 for Exit

 

, ,

No Comments

Control agent problem (OVO)

Sometimes the OVO agent stops communicating with the OVO Server.

Control agent on nodeHOST isn't accessible. (OpC40-405) Network communication problem: Could not obtain endpoint information from node ncadg_ip_udp:10.0.0.10[]. (OpC40-399)

To reestablish the communication, you should restart it:

To stop, use the command:

/opt/OV/bin/OpC/opcagt -stop

Check if it is stopped:

/opt/OV/bin/OpC/opcagt -status
ITO Managed Node status :
-------------------------
Control Agent /opt/OV/bin/OpC/opcctla               (3818) is running
Message Agent /opt/OV/bin/OpC/opcmsga               (3819) is running
Subagent 1:
Action Agent /opt/OV/bin/OpC/opcacta                (3820) is running
Logfile Encapsulator /opt/OV/bin/OpC/opcle          (3821) is running
Monitor Agent /opt/OV/bin/OpC/opcmona               (3822) is running
Message Interceptor /opt/OV/bin/OpC/opcmsgi         (3823) is running

Attention: the "Control Agent" may not stop, you can kill it with a "kill -9 PID"

To start, use the command:

/opt/OV/bin/OpC/opcagt -start

, ,

No Comments

Check powerpath links in HP-UX

To check if the powerpath links are up in HP-UX, you can use the following command:

powermt display dev=all

, , ,

No Comments

When Glance stop working

Sometimes glance (performance monitor for HP-UX) can crash (before crash, it will return 0% of CPU, Disk and networking) working with the following error:

GlancePlus fatal error.
== Fatal Nums Error == C.04.50.57 02/10/07 ==
User: root/6pts/6(/dev/pts/6) Date: Sun Dec 6 15:52:12
File: /crm/numsVob/hp/11.0/nums.C Line: 485 Product id: Glance
System: server B.11.11 9000/800
Errno: 0 (Error 0)
Connection to midaemon lost — check midaemon process and status.mi == End of Error Msg
=============================

To solve it, you should:

Stop MWA:

mwa stop

Remove all files (including the hidden ones) from /var/opt/perf/datafiles:

rm -rf /var/opt/perf/datafiles/* rm -rf /var/opt/perf/datafiles/.*

Check if midaemon and ttd are stopped:

mwa status

If midaemon and ttd didn’t stop, force stops them with the command kill (the PID was returned by the command ‘mwa status’).

Now, start MWA again:

mwa start

,

No Comments

Disable file size limit in AIX

By default, if you try do copy/create a file larger than 2Gb in AIX, you will get a “file too large” message. That happen because AIX have a default limit of 2Gb for files.

To disable (or increase) this limit, edit /etc/security/limits and change the parameter fsize to “-1” or whatever value you want.

You can change it in “default” to apply to all users or change it to a specific user.

Remember that the file system should be JFS2.

, ,

No Comments

Working with “SVC”

Follow useful commands to work with “SVC” in Solaris:

More option can be found at “man svcadm”

svcs -a -> list all installed services.
svcadm disable SERVICE -> disable a service. if you use “svcadm disable -t SERVICE”, the service will be disabled only until the next reboot. You can use this commando to stop a service.
svcadm enable SERVICE -> enable a service. If you use “svcadm enable -t SERVICE”, the service will not be enabled automatically on reboot.
svcadm restart SERVICE -> restart a service.
svcadm reload SERVICE -> reload the configuration file.

More options can be found at “man svcadm”

, , ,

No Comments

Creating an user on AIX

Creating an user on AIX

On AIX, you can use the following commands to create an user

mkuser pgrp=’primary group’ groups=’other groups’ home=’home directory’ shell=’/usr/bin/ksh’ gecos=’GECOS’ USERNAME

, ,

No Comments

Forcing an user changing the password on AIX

Forcing an user changing the password on AIX

On AIX, you can use the following commands to unlock na user and force it to change it’s password on first logon:

pwdadm -f ADMCHG USER

, ,

No Comments

Martian Friend

You may find some weird messages indications in your syslog telling you something like “martian source” like the followings:

 

When a host needs send a package to another host, it can define the route on the network or use the default route. Those “source routed packages” are identified in Linux as martian packages. You can configure your Linux log/do not log those packages:

echo 0 > /proc/sys/net/ipv4/conf/*/log_martians #do not log

, ,

No Comments

Merge many depots

When you have many depot files, you can create a single big depot and install it instead of install one by one.

Let’s assume that you need install the following depots, and they are all located in the directory /tmp/install/depots:

autoconf-2.64-hppa-11.11.depot
bison-2.4.1-hppa-11.11.depot
gawk-3.1.7-hppa-11.11.depot
sed-4.2.1-hppa-11.11.depot
tcltk-8.5.7-hppa-11.11.depot
texinfo-4.13-hppa-11.11.depot
zip-3.0-hppa-11.11.depot

To create a single depot, run the follow commands:

cd /tmp/install/
for i in `ls depots/*.depot` ;do swcopy -s /tmp/install/$i \* @/tmp/install/big;done

Now, to install it, you can use:

swinstall -s /tmp/install/big

, , ,

No Comments

Solaris and NRPE

A very nice guide to install NRPE and nagios-plugins on Solaris 10 can be found here.

To stop/start the NRPE, you can use the following command:

svcadm disable svc:/network/nrpe/tcp
svcadm enable svc:/network/nrpe/tcp

If you keep getting the “CHECK_NRPE: Error – Could not complete SSL handshake.” message, see this FAQ comment

, , ,

No Comments

Resizing lvol in Red Hat AS 4

As incredible as it seems, RHAS4 doesn’t came with the resize2fs command (just like the others RH distributions). After some research, I found the tool that replace the resize2fs command and it’s the ext2online, for example:

ext2online /dev/mapper/VG00-vl02


, ,

No Comments

Rotate log files in Linux

An easy way to rotate log files in Linux can be:

#!/bin/bash

# Include the following line in crontab:

#00 5 * * * /bin/rotate_logs.sh > /dev/null 2>&1

#

DATE=`date “+%Y%m%d”`

cd /var/log/

for i in messages secure cron lastlog

do

cp ${i} ${i}.${DATE}

> ${i}

gzip -9 ${i}.${DATE}

done

/etc/init.d/syslog restart

If you have any other log to rotate, you can change the line 8 and 10.

,

No Comments

Recovering corrupted lvol on HP-UX

Sometimes you can get the following error while try to access a directory in HP-UX:

hpuxbox@root:/root # cd /DATA

sh: /DATA: The specified directory is not valid.


This error is caused because the file system is corrupted and you need run fsck on it.

First of all, umount the FS:

hpuxbox@root:/root # umount /DATA


And them, run the fsck:

hpuxbox @root:/root # fsck -y -o full /dev/vgLOG/lvol1on clear? (ynq)y

UX:vxfs fsck: WARNING: V-3-20836: file system had I/O error(s) on meta-data.

log replay in progress

pass0 – checking structural files

pass1 – checking inode sanity and blocks

fileset 999 primary-ilist inode 177502 marked bad, allocation flags (0×0001)

fileset 999 primary-ilist inode 177502 has invalid number of blocks (7309)

fileset 999 primary-ilist inode 177502 has invalid block map

fileset 999 primary-ilist inode 177502 failed validation clear? (ynq)y

fileset 999 primary-ilist inode 177859 marked bad, allocation flags (0×0001)

fileset 999 primary-ilist inode 177859 has invalid number of blocks (24850)

fileset 999 primary-ilist inode 177859 has invalid block map

fileset 999 primary-ilist inode 177859 failed validation clear? (ynq)y

fileset 999 primary-ilist inode 178243 marked bad, allocation flags (0×0001)

fileset 999 primary-ilist inode 178243 has invalid number of blocks (6417)

fileset 999 primary-ilist inode 178243 has invalid block map

fileset 999 primary-ilist inode 178243 failed validation clear? (ynq)y

fileset 999 primary-ilist inode 178793 marked bad, allocation flags (0×0001)

fileset 999 primary-ilist inode 178793 failed validation clear? (ynq)y

pass2 – checking directory linkage

pass3 – checking reference counts

pass4 – checking resource maps

fileset 999 au 2 imap incorrect – fix (ynq)y

fileset 999 au 2 iemap incorrect – fix (ynq)y

au 42 emap incorrect – fix? (ynq)y

au 42 summary incorrect – fix? (ynq)y

au 59 emap incorrect – fix? (ynq)y

au 59 summary incorrect – fix? (ynq)y

au 60 emap incorrect – fix? (ynq)y

au 60 summary incorrect – fix? (ynq)y

au 61 emap incorrect – fix? (ynq)y

au 61 summary incorrect – fix? (ynq)y

au 62 emap incorrect – fix? (ynq)y

au 62 summary incorrect – fix? (ynq)y

au 63 emap incorrect – fix? (ynq)y

au 63 summary incorrect – fix? (ynq)y

fileset 999 iau 2 summary incorrect – fix? (ynq)y

free block count incorrect 2153192 expected 2202289 fix? (ynq)y

free extent vector incorrect fix? (ynq)y

OK to clear log? (ynq)y

set state to CLEAN? (ynq)y


After that, you can mount the FS again.

hpuxbox@root:/root # umount /DATA

,

No Comments

Disable CTRL+C on Linux


To disable CTRL+C on Linux, you can use the following command:

stty intr undef

,

No Comments

Using vi as crontab editor

Hi!

The default Debian installation use a non-vi editor when you try to use crontab (ie: “crontab -e”).

To change it to vi, you should do the following:

rm -f /etc/alternatives/editor
ln -s /usr/bin/vi /etc/alternatives/editor

, ,

No Comments