বুধবার, ১৩ নভেম্বর, ২০১৩

Conversion from Timeticks to Days/Hours/Minutes/Seconds:

Conversion from Timeticks to Days/Hours/Minutes/Seconds:

1. timeticks / 100 = seconds
2. timeticks / 6000 = minutes
3. timeticks / 360000 = hours
4. timeticks / 8640000 = days

মঙ্গলবার, ১২ নভেম্বর, ২০১৩

Observium Installation on Debian



Observium Installation on Debian:

1.     Install Prerequisites by below command.
#apt-get install libapache2-mod-php5 php5-cli php5-mysql php5-gd php5-snmp php-pear snmp graphviz php5-mcrypt php5-json subversion mysql-server mysql-client rrdtool fping imagemagick whois mtr-tiny nmap ipmitool python-mysqldb
2.    If you want to be able to monitor libvirt virtual machines, install libvirt-bin (beware: this pulls in a whole bunch of dependencies you otherwise probably wouldn't need on your server):
#apt-get install libvirt-bin
3.    Create a directory for Observium to live in:
#mkdir -p /opt/observium && cd /opt
4.    If you would like to try out Observium using the Community/Open Source Edition, please install using the most recent .tar.gz release.
          Download the latest .tar.gz of Observium and unpack:
      
 #wget http://www.observium.org/observium-community-latest.tar.gz
    #tar zxvf observium-community-latest.tar.gz
5.    Change into the new install directory:
#cd observium
Copy the default configuration file and edit it for your system:
#cp config.php.default config.php
6.    Create the MySQL database:
#mysql -u root –p
mysql> CREATE DATABASE observium;
mysql> GRANT ALL PRIVILEGES ON observium.* TO 'observium'@'localhost'
       -> IDENTIFIED BY '';
7.       Edit config.php. Change the options to reflect your installation. Change the db_user name and password as you provide by previous command.
$config['db_user'] = "observium";
$config['db_pass'] = "hadi123";
8.    Setup the MySQL database and insert the default schema:
#php includes/update/update.php
9.    Create the directory to store RRDs in:
#mkdir rrd
#chown www-data:www-data rrd
10.   Create  config file by    
#
vim /etc/httpd/conf.d/observium.conf
and Add below lines
DocumentRoot /opt/observium/html/
ServerName  observium.domain.com
CustomLog /opt/observium/logs/access_log combined
ErrorLog /opt/observium/logs/error_log

AllowOverride All
Options FollowSymLinks MultiViews
11.   Create logs directory for apache 
# mkdir /opt/observium/logs
# chown www-data:www-data /opt/observium/logs
12. If OS is Debian > 6.0 and ubuntu > 11.04 then
Remove this line in /etc/snmp/snmp.conf:
mibs :
and add the following line:
mibdirs /opt/observium/mibs
13. Enable mod_rewrite for Observium's cleaner URLs:
#a2enmod rewrite
#apache2ctl restart
14. Add a first user, use level of 10 for admin:
#cd /opt/observium
#./adduser.php   
[Example# ./adduser.php hadi hadi123 10]
15. Add a first device to monitor:
#./add_device.php   v2c
16. Do an initial discovery and polling run to populate the data for the new device:
#./discovery.php -h all
#./poller.php -h all
17. Add cron jobs, create a new file /etc/cron.d/observium with the following contents:
33  */6   * * *   root    /opt/observium/discovery.php -h all >> /dev/null 2>&1
*/5 *     * * *   root    /opt/observium/discovery.php -h new >> /dev/null 2>&1
*/5 *     * * *   root    /opt/observium/poller-wrapper.py 1 >> /dev/null 2>&1
18. You should now be able to see http:///observium

Cacti 0.8.7g Installation on Debian:



Cacti 0.8.7g Installation on Debian:

1.       Prerequisites : apache2, php5, php5-common, php5-cgi, php5-cli, mysql-server, php5-mysql, snmp, rrdtool, php5-gd.
2.       Apt-get install apache2 php5  php5-common  php5-cgi  php5-cli  snmp  rrdtool mysql-server php5-mysql  php5-gd cacti.
3.       Set mysql root user password, mysql cacti user password and web server used by cacti during installation.
4.       Now cacti is ready to be used.
5.       http:// address>/cacti/
6.       User: admin and password admin. Then change the admin password.
Then add device and create graphs.

বুধবার, ৯ অক্টোবর, ২০১৩

Cisco ASA 55XX Password Recovery Process

Cisco ASA 55XX Password Recovery Process:

1.       Power cycle the ASA by unplugging and plugging back in the power adapter.
2.        While restarting, press ESC or Break to enter the ROM Monitor mode. prompt should look like (rommon#0)
3.       Enter command confreg. This will show the current configuration register, which should be 0×00000001. Say NO to change prompt.
4.       Change configuration register to 0×41 to ignore the Startup-configuration on boot.  To do this please type  (rommon#1)  confreg 0×41
5.        Reboot  the ASA with (rommon#2)  boot command.
6.        ASA will reboot and show the default prompt ciscoasa>
7.        Do ciscoasa>enable and press Enter.
8.       Press Enter. (Password is blank)
9.       You should be in privileged mode ciscoasa#
10.   Run ciscoasa# copy start run
11.   Destination File name [running-conf ig]
12.   Enter the ASA configuration mode. ciscoasa# config terminal
13.   Now set the new password of your choice. ciscoasa(conf ig) # enable password
14.   Change configuration register back to 0×00000001 to boot from startup-config.             
ciscoasa(conf ig) # config-register 0×01
15.   Save the running-config to startup-config. ciscoasa# copy run start

16.   Reload the ASA. ciscoasa# reload

বৃহস্পতিবার, ১৯ সেপ্টেম্বর, ২০১৩

Asterisk Installation on Debian



Asterisk 11 Installation on Debian 6.0.7:
--------------------------------------

Asterisk is an Open Source software PBX (Private Branch Exchange), developed by Mark Specer of Digium. It allows you to make calls to one another which may have connected to other PSTN (Public Switched Telephone Network) and Voice over Internet Protocol(VoIP). Asterisk runs on Linux, BSD, MacOSX and others. Having built-in features like voicemail, conferencing, IVR, queuing etc.
In this article, we are going to see a basic installation and working of Asterisk 11 in Debian Linux Operating Systems.

# apt-get update && apt-get upgrade -y && reboot
# apt-get install build-essential wget libssl-dev libncurses5-dev libnewt-dev  libxml2-dev linux-headers-$(uname -r) libsqlite3-dev uuid-dev

2. Downloading DAHDI, LibPRI and Asterisk Tarballs

Download the source tarballs, these following commands will download current release of DAHDI 2.6, 
LibPRI1.4 and Asterisk11.
# cd /usr/src/
# wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gz
# wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/
       dahdi-linux-complete-current.tar.gz
# wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-11-current.tar.gz
Next, extract the files from source tarballs using “tar command” as shown below.
# tar zxvf dahdi-linux-complete-current.tar.gz
# tar zxvf libpri-1.4-current.tar.gz
# tar zxvf asterisk-11-current.tar.gz

3. Configuring, Compiling And Installing

Go to the each directory from where you have downloaded and extracted the packages and start running the following commands to install DAHDI, LibPRI and Asterisk.

Installing DAHDI.
# cd /usr/src/dahdi-linux-complete-2.6.2+2.6.2/
# make && make install && make config
Installing LibPRI
# cd /usr/src/libpri-1.4.14/
# make && make install
Installing Asterisk

Next, run the “configure” script will vary depending upon whether your system is 32-bit or 64-bit. In the middle, when “menuselect” command executes, select your desired options and then hit “Save and Exit” option and the installation will continuous.
Run this command if you’re installing Asterisk on a 32-bit OS. 
# cd /usr/src/asterisk-11.3.0/
# ./configure && make menuselect && make && make install && make samples && make config
Run this command if you’re installing Asterisk on a 64-bit OS.
# cd /usr/src/asterisk-11.3.0/
# ./configure --libdir=/usr/lib64 && make menuselect && make && make install && make samples
  && make config

Following are the some Asterisk configuration files and their locations.
o    /etc/asterisk/ – configuration files.
o    /var/lib/asterisk/ – contains images, firmware, keys, sounds sample files.
o    /usr/lib/asterisk/modules/ – contains all loadable modules.


Starting DAHDI and Asterisk Services

Enable the DAHDI and Asterisk services at system boot time. 
# chkconfig dahdi on
# chkconfig asterisk on
Start the DAHDI and Asterisk.
# service dahdi start
# service asterisk start

5. Connecting to Asterisk CLI

Run the following command to connect to the Asterisk CLI.


# asterisk -rvvvvv

Asterisk 11.3.0, Copyright (C) 1999 - 2012 Digium, Inc. and others.

Created by Mark Spencer markster@digium.com

Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.

=========================================================================

Connected to Asterisk 11.3.0 currently running on tecmint (pid = 1820)
tecmint*CLI>

6. Asterisk Console Commands

It’s similar to IOS. From Asterisk terminal anytime you can use ‘Tab key‘ or type ‘?‘ for help or command auto complete.
*CLI>
       

7. Useful Commands from Asterisk CLI

o    restart gracefully – Restart Asterisk gracefully.
o    restart now – Restart immediately.
o    restart when convenient – Restart Asterisk when call is empty.
o    reload – Configuration reload.
o    stop gracefully – Gracefully Asterisk shutdown.
o    stop now – Shutdown immediately.
o    stop when convenient – Shutdown Asterisk when call is empty.

8. Command Line Parameters

Following are the available command line parameters of Asterisk.
-h : Help. Run '/sbin/asterisk -h' to get a list of the available command line parameters.
-C : Starts Asterisk with a different configuration file than the default 
/etc/asterisk/asterisk.conf.
-f : Foreground. Starts Asterisk but does not fork as a background daemon.
-c : Enables console mode. Starts Asterisk in the foreground (implies -f), with a console 
     command line interface (CLI) that can be used to issue commands and view the state of 
     the system.
-r : Remote console. Starts a CLI console which connects to an instance of Asterisk already 
     running on this machine as a background daemon.
-R : Remote console. Starts a CLI console which connects to an instance of Asterisk already 
    running on this machine as a background daemon and attempts to reconnect if disconnected.
-t : Record soundfiles in /var/tmp and move them where they belong after they are done.
-T : Display the time in "Mmm dd hh:mm:ss" format for each line of output to the CLI.
-n : Disable console colorization (for use with -c or -r)
-i: Prompt for cryptographic initialization passcodes at startup.
-p : Run as pseudo-realtime thread. Run with a real-time priority. (Whatever that means.)
-q : Quiet mode (supress output)
-v : Increase verbosity (multiple v's = more verbose)
-V : Display version number and exit.
-d : Enable extra debugging across all modules.
-g : Makes Asterisk dump core in the case of a segmentation violation.
-G  : Run as a group other than the caller.
-U  : Run as a user other than the caller
-x  : Execute command  (only valid with -r)