Sunday, September 10, 2006

Success in Asterisk Clustering




HA

Provide a high-availability (clustering) solution for Linux which promotes reliability, availability, and serviceability (RAS) through a community development effort.

from: http://asteriskprojects.com/?page_id=4


ha.cf
------------------------------------------------------------
logfacility local0
keepalive 2
deadtime 20
warntime 10
initdead 70
udpport 694
#baud 19200
#serial /dev/ttyS0 # Linux
bcast eth1 # Linux
#ucast eth1 192.168.43.12
auto_failback on
#stonith_host * baytech 10.0.0.3 mylogin mysecretpassword
#stonith_host ken3 rps10 /dev/ttyS1 kathy 0
#stonith_host kathy rps10 /dev/ttyS1 ken3 0

#set kernel "nowayout=0" for that
#watchdog /dev/watchdog
node asterisk1.local asterisk2.local
--------------------------------------------------------------

haresources
--------------------------------------------------------------
asterisk1.local 192.168.22.99/24/eth0 drbddisk::shared Filesystem::/dev/drbd0::/share::ext3 drbdlinks mysqld sendmail asterisk httpd munin-node vsftpd ircd xplhub amportal xinetd
--------------------------------------------------------------

drbd.conf
--------------------------------------------------------------
global {
}

resource "shared" {
protocol C;
incon-degr-cmd "echo '!DRBD! pri on incon-degr' | wall ; sleep 60 ; halt -f";
startup {
wfc-timeout 0; ## Infinite!
degr-wfc-timeout 120; ## 2 minutes.
}
disk {
on-io-error detach;
}
net {
# timeout 60;
# connect-int 10;
# ping-int 10;
# max-buffers 2048;
# max-epoch-size 2048;
}
syncer {
rate 10M;
group 1;
}

on asterisk1.local {
device /dev/drbd0;
disk /dev/sda4;
address 192.168.43.11:7789;
meta-disk internal;
}

on asterisk2.local {
device /dev/drbd0;
disk /dev/hda4;
address 192.168.43.12:7789;
meta-disk internal;
}
}

--------------------------------------------------------------

authkeys
--------------------------------------------------------------
auth 1
1 crc
#2 sha1 HI!
#3 md5 Hello!
--------------------------------------------------------------

Saturday, September 09, 2006

Got Gemei X-120 mp4

Got Gemei X-120 mp4 from my Father as a gift.
:)

Sunday, September 03, 2006

Success in OpenNMS


Today I setup OpenNMS in Debian sarge

/etc/apt/source/list
deb http://debian.opennms.org/ debian/opennms stable

# apt-get install java-common
# apt-get install sun-jdk1.4-installer
# build-sun-jdk14 ./j2sdk-1_4_2_05-linux-i586.bin
# dpkg -i j2sdk-1_4_2_05-linux-i586.deb

java-virtual-machine meta-package
# apt-get install java-virtual-machine

#apt-get install tomcat4 tomcat4-admin tomcat4-webapps

# apt-get install rrdtool
# apt-get install mrtg

/etc/postgresql/postgresql.conf

tcpip_socket = true
shared_buffers = 1024

/etc/postgresql/pg_hba.conf
# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
local all all trust
host all all 127.0.0.1 255.255.255.255 trust
host all all ::1 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff trust


#apt-get install opennms opennms-common opennms-contrib opennms-db opennms-server opennms-webapp


Search for a JRE (suggested)
#cd /usr/share/opennms/bin
#./runjava -s

Run the Installer to Setup the PostgreSQL Database
#cd /usr/share/opennms/
#install -disU

Run the Installer to Setup the Web Application
#cd /usr/share/opennms/
# ./install -w /var/lib/tomcat4/webapps -W /var/lib/tomcat4/server/lib


edit /usr/share/opennms/etc/discovery-configuration.xml

include-range retries="2" timeout="3000"
begin 192.168.0.1 begin
end 192.168.0.254 end


start or restart

# /etc/init.d/postgres start
# /etc/init.d/tomcat4 start
# /etc/init.d/opennms start


http://opennms_installed_pc_ip:8180/opennms/

The initial user name is "admin" and the password is "admin".
(note: 8180 for debian)
(other Linux http://host:8080/opennms/)


edit capsd-configuration.xml for the service your want to monitor

capsd-configuration.xml
==============
scan="on"

example:
protocol-plugin protocol="Postgres" class-name="org.opennms.netmgt.capsd.TcpPlugin" scan="on" user-defined="false"
==============

your can finish here if u do not want to enable snmp & notification.


Enable SNMP in a server that you want to monitor. Then...

edit datacollection-config.xml to enable more monitoring graph in opennms.

datacollection-config.xml
===============
snmp-collection name="default"
maxVarsPerPdu = "50"
snmpStorageFlag = "all"
rrd step = "300"
===============


edit the snmp-config.xml to track servers with snmp

snmp-config.xml
==========
specific 192.168.25.32 specific
range begin="192.168.25.1" end="192.168.25.254"
==========


edit poller-configuration.xml

poller-configuration.xml
===============
status="on"

example:
service name="SMTP" interval="300000" user-defined="false" status="on"
===============


edit notifd-configuration.xml to enable notification
==============================
status="on"

example:
notifd-configuration
status="on"
pages-sent="SELECT * FROM notifications"
next-notif-id="SELECT nextval('notifynxtid')"
next-group-id="SELECT nextval('notifygrpid')"
==============================


edit javamail-configuration.properties for mail notification

javamail-configuration.properties
====================
# Properties are defined but commented out indicating the default values.
# This property defines system sender account.
#
# The default setting is root@[127.0.0.1]
#org.opennms.core.utils.fromAddress=root@localhost

#
# This property defines SMTP Host.
#
org.opennms.core.utils.mailHost=smtp.xyz.net
org.opennms.core.utils.mailer=smtpsend
org.opennms.core.utils.transport=smtp
org.opennms.core.utils.debug=true
#
# This property defines Mail authentication.
# The default setting is false
#org.opennms.core.utils.authenticate=false
#org.opennms.core.utils.authenticateUser="opennms"
#org.opennms.core.utils.authenticatePassword="opennms"

# This property controls the use of the JMTA, the
# default is true
#org.opennms.core.utils.useJMTA=true
==========================

set the email address via opennms visual configuration to receive emails.


done :)