Giter Club home page Giter Club logo

kannelsetup_centos7's Introduction

Kannel Installation On Centos 7

Step 1: Update System:


Note : Start by updating your package repositories and upgrading installed packages:

sudo apt update
sudo apt upgrade

Step 2 : Dependecies :

 yum install -y openssl-devel  libxml2-devel   texlive-*  m4  gcc-c++ make
 yum install -y openssl-devel  libxml2-devel   texlive-*  m4  gcc-c++ make
 cd usr/local
 curl -O https://ftp.gnu.org/gnu/bison/bison-2.7.tar.gz
 tar zxvf bison-2.7.tar.gz && cd bison-2.7 && ./configure && make && make install && cd src
 rm -rf  /usr/local/bin/bison 
 rm -rf /usr/bin/bison
 cp bison /usr/local/bin/bison && cp bison /usr/bin/bison
 cd .. && cd .. && rm -rf bison-2.7.tar.gz bison-2.7 

Step 3 : Download Kannel and Complie And Install

cmd : curl -O -k https://www.kannel.org/download/1.4.5/gateway-1.4.5.tar.gz
cmd : tar -xvzf gateway-1.4.5.tar.gz
cmd : rm -rf gateway-1.4.5.zip (Remove)
cmd : cd gateway-1.4.5
cmd : ./configure   --prefix=/usr/local/gateway-1.4.5
cmd : make
cmd : make install

Command To Start Kannel Manual

--start kannel
/usr/local/gateway-1.4.5/gw/bearerbox  /usr/local/gateway-1.4.5/gw/smskannel.conf &> /dev/null &
/usr/local/gateway-1.4.5/gw/smsbox  /usr/local/gateway-1.4.5/gw/smskannel.conf &> /dev/null &

Note: The command '&> /dev/null &' is used to run a program in the background while discarding its output. The & at the end makes the command run in the background, and >/dev/null redirects both standard output and standard error to /dev/null, effectively silencing any output produced by the command. This is often used when you don't need to see or log the output of a background process.


Start Automatically Process Using Crone Job

Step 1: Create File Like checkKannel

cmd : mkdir usr/local/scripts
cmd : cd usr/local/scripts
cmd : vi checkKannel
  • Then Paste Below Code in file and then save file
	if /usr/local/nagios/libexec/check_tcp localhost -p 1403 | grep "Connection refused"
	then
	#killall -9 bearerbox smsbox
	/usr/local/gateway-1.4.5/gw/bearerbox /usr/local/gateway-1.4.5/gw/smskannel.conf &> /dev/null &
	sleep 4
	/usr/local/gateway-1.4.5/gw/smsbox /usr/local/gateway-1.4.5/gw/smskannel.conf &> /dev/null &
	fi

	if /usr/local/nagios/libexec/check_tcp localhost -p 13013  | grep "Connection refused"
	then
	#killall -9 bearerbox smsbox
	/usr/local/gateway-1.4.5/gw/bearerbox /usr/local/gateway-1.4.5/gw/smskannel.conf &> /dev/null &
	sleep 4
	/usr/local/gateway-1.4.5/gw/smsbox /usr/local/gateway-1.4.5/gw/smskannel.conf &> /dev/null &
	fi

Note : above use port 1403 is admin port from config and 13013 is send sms user port from config file

  • Give Permission To File For Run (below Command set this permission -rwxr-xr-x )
cmd : chmod 755 checkKannel
cmd : crontab -e
  • Then paste below code in file
	* * * * * usr/local/scripts/checkKannel

Required Nagois for working cronjob code

Note: Nagios is a monitoring system that keeps an eye on your computers and networks. It alerts you when things go wrong and lets you know when they get better. It helps organizations identify and resolve IT infrastructure issues, ensuring that critical systems are always up and running smoothly.

Step 1 : System Update

cmd : sudo yum update

Step 2 : Install Required Dependencies:

cmd : sudo yum install -y gcc glibc glibc-common wget unzip httpd php gd gd-devel perl postfix

Step 3 : Create a Nagios User and Group:

cmd : sudo useradd nagios
cmd : sudo groupadd nagcmd
cmd : sudo usermod -a -G nagcmd nagios

Step 5 : Download and Compile Nagios Core:

cmd : wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.4.6.tar.gz
cmd : tar -xzf nagios-4.4.6.tar.gz
cmd : cd nagios-4.4.6
cmd : ./configure --with-command-group=nagcmd
cmd : make all
cmd : sudo make install
cmd : sudo make install-commandmode
cmd : sudo make install-init
cmd : sudo make install-config

Step 6 : Create a Nagios Web User Account:

cmd : sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

Step 7 : Download and Install Nagios Plugins:

cmd : cd ~
cmd : wget https://nagios-plugins.org/download/nagios-plugins-2.3.3.tar.gz
cmd : tar -xzf nagios-plugins-2.3.3.tar.gz
cmd : cd nagios-plugins-2.3.3
cmd : ./configure --with-nagios-user=nagios --with-nagios-group=nagios
cmd : make
cmd : sudo make install

Step 8 : Start and Enable Apache and Nagios Services:

cmd : sudo systemctl start httpd
cmd : sudo systemctl enable httpd
cmd : sudo systemctl start nagios
cmd : sudo systemctl enable nagios

Enable Port (If Sometime give error then reboot server then try again)

cmd : sudo systemctl status firewalld
cmd : sudo firewall-cmd --zone=public --add-port=1403/tcp --permanent
cmd : sudo firewall-cmd --zone=public --add-port=1505/tcp --permanent
cmd : sudo firewall-cmd --zone=public --add-port=13013/tcp --permanent
cmd : firewall-cmd --reload

Kannel Log File Rotation Setting

cmd : cd /etc/logrotate.d
cmd : vi kannel
File Format
/var/log/kannel/*.log {
          daily
          missingok
          rotate 31
          compress
          delaycompress
          notifempty
          create 640 root root
          sharedscripts
          postrotate
                killall -HUP bearerbox smsbox || true > /dev/null 2> /dev/null
          endscript
}

kannelsetup_centos7's People

Contributors

innovativevijay avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.