Tuesday, February 2, 2010

How to copy ssh public key to remote machine

Actually following command not only perform copying ssh public key to remote machine but also remove authorized_keys and known-hosts old files simultaneously.

cat ~/.ssh/id_dsa.pub |ssh root@remote_machine 'sh -c "cat - >>~/.ssh/authorized_keys2;rm ~/.ssh/authorized_keys;rm ~/.ssh/known_hosts"'

Nagios Configuration on SuSE 9

At /home nrpe-plugins.tar.gz should be copied then
tar zxvf nrpe-plugins.tar.gz; mv nagios /usr/local ; mv nrpe.cfg /etc/ ; mv nrpe /usr/local/sbin

configure nrpe.cfg as you like and whatever you want to monitor then,

chmod 644 /etc/nrpe.cfg

in /etc/services add following line at end

nrpe 5666/tcp # NRPE

copy nrpe or create nrpe file as under:

service nrpe
{
disable = no
flags = REUSE
type = UNLISTED
port = 5666
socket_type = stream
wait = no
user = nobody
group = nobody
server = /usr/local/sbin/nrpe
server_args = -n -c /etc/nrpe.cfg --inetd
log_on_failure += USERID
only_from = 127.0.0.1 nagios_server_ip
}

as nrpe plugin is running under xinetd therefore run following command

/usr/sbin/rcxinetd restart

Knowledge is dead without practice

Saturday, January 9, 2010

Joined Blog Today

Today i have joined this Blog. Let see what I can upload here..