Posts

Showing posts from January, 2012

Nagios on ubuntu

In the snereo, we have two machines, one is ubuntu server 10.04 machine(which will be used for nagios monitoring) and other is ubuntu 10.10 machine(a remote host to be monitored by nagios). I have a bare minimal installation of both machines. On Nagios server Install the required packages: root@nagios-ubuntu:~#apt-get -y install ssh php5-gd gcc make build-essential libgd2-xpm-dev libssl-dev #Adding a user for nagios process root@nagios-ubuntu:~#useradd -m nagios root@nagios-ubuntu:~#passwd nagios Usually when a new user is created if no group is assigned a group with the user_name is created & assigned to the user. But still it is a healthy practice to create a nagios group and adding nagios user to that group and to www-data i.e. apache2 group root@nagios-ubuntu:~#groupadd nagios root@nagios-ubuntu:~#usermod -G nagios nagios root@nagios-ubuntu:~#usermod -a -G nagios nagios root@nagios-ubuntu:~#usermod -a -G nagios www-data To avoid from mess, create a separate directory a

Adding Virtual nic's to *nix

Some time we have to add virtual nics to our *nix machine to do that copy the eth0 config file from /etc/sysconfig/network-scripts/ like [root@test ~]#cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:1 Just edit the eth0:1 file a little bit to serve the purpose & remove the "HWADDR" line from the config file [root@test ~]#vim /etc/sysconfig/network-scripts/ifcfg-eth0\:1 After editing file will look like this DEVICE=eth0:1 BOOTPROTO=none ONBOOT=yes NETMASK=255.255.255.0 IPADDR=192.168.56.102 GATEWAY=192.168.56.1 TYPE=Ethernet USERCTL=no IPV6INIT=no PEERDNS=yes Now you can use ifup command to make the virtual nic UP Like [root@test ~]#ifup eth0:1 In Debian & other distro's based on debian Open the interfaces config. file root@debian:~# vim /etc/network/interfaces The file will look like this auto eth0 iface eth0 inet static address 192.168.56.101 netmask 255.255.255.0 Now start adding the bel