Thursday, February 26, 2015

install and configure Xymon to monitor Slackware part 2

cd /home/xymon/server/etc
nano bb-hosts
write

192.168.28.160  xpvirtual.sourav.com  #XP
save and exit
su xymon
/home/xymon/server/hobbit.sh stop
/home/xymon/server/hobbit.sh start
go to
192.168.28.51/xymon
and you should see the xpvirtual.sourav.com entry
install bbwin on windows xp client
select full features to be installed
run regedit
hkey local machine-software-BBWin
on the right side pane
right click on hostname and click modify
paste xpvirtual.sourav.com under value data
open
c:\Program Files\BBWin\etc\BBWin.cfg in notepad
make the first line look like this

where 192.168.28.51 is the ip of the xymon server

go to services.msc
start the Big brother xymon client and make the service automatic at startup if it is manual
Now on windows xp run-firewall.cpl
advanced ,local area connection ,settings
on the icmp tab
click on the allow incoming echo request
Now on the xymon server

/home/xymon/server/hobbit.sh stop
/home/xymon/server/hobbit.sh start
Now go to
go to
192.168.28.51/xymon
you should see more information about xpvirtual.sourav.com
Now on the xymon server
cd /home/xymon/server/etc

make the end look like this
page linux Linux
group-compress (less than sign)font size="+1"("greater than sign")Linux("less than sign")/font"("greater than sign")
192.168.28.51   slackwarepc      # bbd http://slackwarepc/
page workstation Workstation
group-compress (<)font size="+1"(>)Workstation(<)/font(>)
10.10.29.141    MyPC             #Win8
192.168.28.160  xpvirtual.sourav.com  #XP

save and exit
/home/xymon/server/hobbit.sh stop
/home/xymon/server/hobbit.sh start
go to
192.168.28.51/xymon
you should see the two divisions named Linux and Workstaions

Sourav Bhattacharya
(Slackware Lover)



 

Sunday, February 22, 2015

Make your lan connections eth0,eth1 from ens33 etc in CentOS 7

yum -y install ftp nano net-tools #(net-tools for ifconfig)

go to /etc/hostname

server1.sourav.com

go to /etc/hosts

the file is like this

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6


make it look like

127.0.0.1  server1.sourav.com localhost localhost.localdomain localhost4 localhost4.localdomain4
::1       server1.sourav.com  localhost localhost.localdomain localhost6 localhost6.localdomain6


now ifconfig command shows the interface as ens33,I want to make the two lan adapter as eth0 and eth1

nano /etc/default/grub

find this line

GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/root crashkernel=auto  vconsole.keymap=us rhgb quiet"

and make it look like that

GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/root crashkernel=auto  vconsole.keymap=us rhgb quiet net.ifnames=0 biosdevname=0"

save and exit

reboot


ifconfig eth0 down

ifconfig eth1 down

and

ifconfig eth0 up

will do the managing for you


run this command

grub2-mkconfig -o /boot/grub2/grub.cfg

reboot

run ifconfig

you will see the network adapters as eth0 and eth1

cd /etc/sysconfig/network-scripts/

mv ifcfg-ens33 ifcfg-eth0

nano ifcfg-eth1

DEVICE="eth1"

NAME="eth1"

IPADDR=10.10.0.1

delete the gate way and dns

delete the uuid

get the proper mac address for ethernet adapter2

BOOTPROTO="static"

ONBOOT="yes"

Del PEERROUTES,PEERDNS,DEFROUTE portions on eth1


save and exit


systemctl stop NetworkManager

systemctl disable NetworkManager

systemctl restart network

now you are fine

For more information 



http://unix.stackexchange.com/questions/81834/how-can-i-change-the-default-ens33-network-device-to-old-eth0-on-fedora-19




Tuesday, February 17, 2015

php mcrypt not found solved and install and enable curl

sudo apt-get install php5-mcrypt
sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available
sudo php5enmod mcrypt 
sudo service apache2 restart

install and enable curl extension

sudo apt-get install curl libcurl3 libcurl3-dev php5-curl

Monday, February 16, 2015

Install and configure Xymon to monitor Slackware part 1

download rrdtool and fping and xymon package in tar.gz format

tar -zxvf fping ...

cd fping ..

./configure

make

make install


tar -zxvf rrdtool...

cd rrdtool

./configure

make

make install

tar -zxvf xymon-...

cd xymon ..

groupadd xymon

useradd xymon -g xymon

./configure.server

keep saying y to the questions(press enter)

when asked which group does the webserver use

the answer should be apache

the ip address of the machine should not be 127.0.0.1

it should be

192.168.28.51

and keep saying yes and you are done


make

make install

type

visudo

or

mcedit /etc/sudoers

under the section

Cmnd alias specification

Write Cmnd_Alias and press tab

Cmnd_Alias    XYM = /usr/local/sbin/fping *

then go to user privilege specification

go to under the line as

root    All=(ALL)  All

type

xymon    All = NOPASSWD: XYM


save and exit

su xymon

and try to run

/usr/local/sbin/fping google.com

and I have faced this error

Fping can only be run by root

So I tried

as root

chown root:xymon /usr/local/sbin/fping

chmod 710 /usr/local/sbin/fping

chmod ug+s /usr/local/sbin/fping

and then

become xymon

su xymon

and then

/usr/local/sbin/fping google.com

the thing is working now

become root

mc

go to /home/xymon/server/etc

see if hobbitserver.cfg exists

go to /etc/httpd/httpd.conf

Under the line

Include /etc/httpd/mod_php.conf

Write

Include /home/xymon/server/etc/hobbit-apache.conf

save and exit

/etc/rc.d/rc.httpd restart

su xymon

/home/xymon/server.hobbit.sh start

ps aux | grep hobbit


Now from a client pc

if I type

http://192.168.28.51/xymon

it shows 404 Not Found URL/xymon was not found on this server

So I went to

cd /home/xymon/server/etc

nano hobbit-apache.conf

find this line

Alias /xymon/  "/home/xymon/server/www/"

and change it to

Alias /xymon  "/home/xymon/server/www"

save and exit

/etc/rc.d/rc.httpd restart

and

open from client pc

192.168.28.51/xymon

it is working now

go to

cd /home/xymon/server/etc

nano bb-hosts

add this line at the last

10.10.29.141    MyPC             #Win8


save and exit

su xymon

/home/xymon/server/hobbit.sh stop

/home/xymon/server/hobbit.sh start

now you will find 2 host on the main view of xymon

at 192.168.28.51/xymon


      

Install and configure MySQL on Slackware

type mc

go to /etc/

copy my-large.cnf to my.cnf by pressing ctrl+F5

make the destination to /etc/my.cnf

press alt+o to save on the last opened window

press ctrl+F10 to exit from mc

type mysql_install_db

chown -R mysql:mysql /var/lib/MySQL

/etc/rc.d/rc.mysqld stop

/etc/rc.d/rc.mydsqld start

ps aux | grep mysql | grep -v grep

mysql should be listed

set root password

UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';