Today I made Zabbix templates, I started doing first under MikroTik RouterBOARD SXT-Lite2 (2nDr2).
Continue reading “SNMP MIBs and OIDs for MikroTik”Author Archives: Vyacheslav
Installing the Digium Asterisk GUI
Digium Asterisk GUI – web-management interface Asterisk.
Today I’ll sculpt it to Asterisk 11 on Ubuntu Server 14.04 LTS.
Switch directly to the root user:
sudo -i
Download it:
apt-get install subversion mkdir -p ~/asterisk-gui cd ~/asterisk-gui svn checkout http://svn.digium.com/svn/asterisk-gui/branches/2.0/
We compile and install:
cd 2.0 ./configure make make install
Just in case, we’ll make a copy of the Asterisk configuration files:
cp -r /etc/asterisk /etc/asterisk.original
Open the configuration file manager.conf for example in the editor nano (Ctrl+X to exit the editor, y/n to save or cancel changes):
nano /etc/asterisk/manager.conf
The main parameters that must be configured in the manager.conf configuration file are:
[general] enabled = yes webenabled = yes bindaddr = 0.0.0.0 [USERNAME] secret = PASSWORD read = system,call,log,verbose,command,agent,user,config write = system,call,log,verbose,command,agent,user,config
At the very end of the file, replace the symbol # with; otherwise you can not enter under the login and password specified above.
Now edit http.conf:
nano /etc/asterisk/http.conf
In it we will specify the following parameters of the web server:
enabled=yes enablestatic=yes bindaddr=0.0.0.0 prefix=asterisk
Let’s check the settings:
make checkconfig
Delete the empty folder and specify a link to the real one with the files of the web server:
rmdir /usr/share/asterisk/static-http/ ln -s /var/lib/asterisk/static-http/ /usr/share/asterisk/
Restarting Asterisk:
/etc/init.d/asterisk restart
Now Digium Asterisk GUI should open by link http://192.168.56.102:8088/asterisk/static/config/index.html, where 192.168.56.102 this is the IP or Server domain with Asterisk.
To log in, we’ll specify the username and password you wrote earlier in the manager.conf file
Done.
Solution to the Asterisk problem – no sound when calling via NAT
I noticed recently that there is no sound when calling from IP-phone to another IP-phone which were both behind the same NAT (router).
Continue reading “Solution to the Asterisk problem – no sound when calling via NAT”Zabbix installation on Ubuntu from distribution packages
On the test, I installed Zabbix 3.4 in Ubuntu 14.04 LTS, Ubuntu 16.04 LTS, Ubuntu 18.04 LTS.
Links to other versions of Zabbix can be found on the official website www.zabbix.com or http://repo.zabbix.com/zabbix/.
For example, Zabbix 3.4 for Ubuntu is located here http://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/.
After installing Zabbix, transferred the data from the old Zabbix 2.2 server to it, simply exporting the templates first, then network nodes, set cards and complex screens.
Let’s proceed to installation, add the official source of packages to the system (example for Ubuntu 14.04 LTS (trusty)):
wget http://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+trusty_all.deb sudo dpkg -i zabbix-release_3.4-1+trusty_all.deb sudo apt update
For Ubuntu 16.04 LTS (xenial):
wget http://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+xenial_all.deb sudo dpkg -i zabbix-release_3.4-1+xenial_all.deb sudo apt update
For Ubuntu 18.04 (Bionic Beaver):
wget http://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+bionic_all.deb sudo dpkg -i zabbix-release_3.4-1+bionic_all.deb sudo apt-get update
Perform the installation of Zabbix:
sudo apt-get install zabbix-server-mysql zabbix-frontend-php zabbix-agent
Connect to the MySQL server and create a database:
mysql -uroot -p create database zabbix character set utf8 collate utf8_bin; grant all privileges on zabbix.* to zabbix@localhost identified by 'ПАРОЛЬ'; quit;
We import the standard data into the created database:
cd /usr/share/doc/zabbix-server-mysql zcat create.sql.gz | mysql -uroot -p zabbix
For example, open the Zabbix server configuration file in the nano text editor (in nano, press Ctrl+X to exit, y/n to save or cancel changes):
sudo nano /etc/zabbix/zabbix_server.conf
Specify the MySQL database name, user name and password:
DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=PASSWORD
Run the Zabbix server process:
sudo service zabbix-server start
You need to fix the PHP configuration for Zabbix. The Apache configuration file for the Zabbix web interface is located in /etc/apache2/conf.d/zabbix or /etc/apache2/conf-enabled/zabbix.conf. Some minimal PHP configuration parameters have already been set there:
php_value max_execution_time 300 php_value memory_limit 128M php_value post_max_size 16M php_value upload_max_filesize 2M php_value max_input_time 300 php_value always_populate_raw_post_data -1 php_value date.timezone Europe/Kiev
Restart the web server to apply the changes:
sudo service apache2 restart sudo service zabbix-server restart
Make sure that the Zabbix agent and the Zabbix server are started at system startup and, if necessary, enable:
sudo systemctl is-enabled zabbix-agent.service sudo systemctl is-enabled zabbix-server.service sudo systemctl enable zabbix-agent.service sudo systemctl enable zabbix-server.service
The Zabbix web interface is available through a browser at http://HOST/zabbix.
By default, the user name for logging in through the web interface is admin or Admin, the password is zabbix.
Asterisk Error Solution “Context ‘local’ tries to include nonexistent context ‘parkedcalls'”
I screwed the DAHDI board somehow and noticed the following error when I dialed the call from the analog line:
WARNING[7238]: pbx.c:12314 ast_context_verify_includes: Context ‘local’ tries to include nonexistent context ‘parkedcalls’
The error occurred because the res_parking module was not loaded to load it, open the asterisk console and execute the command:
sudo asterisk -vvr module load res_parking
To automatically load it when starting Asterisk, in the file /etc/asterisk/modules.conf, in the [modules] block, add the line:
load => res_parking.so
Configuring Asterisk CDR and Asterisk CDR Viewer
CDR (Call Data Record), allows you to keep statistics on call activity in the MySQL database.
Continue reading “Configuring Asterisk CDR and Asterisk CDR Viewer”Configuring FreeRADIUS DHCP for ABillS
Suppose you installed FreeRADIUS 2 as written in this article – Installation and configuration of the ABillS billing system
Now copy the dhcp.conf file into the FreeRADIUS configuration:
sudo cp /usr/abills/misc/freeradius/v2/dhcp.conf /usr/local/freeradius/etc/raddb/sites-enabled/
The solution of the error “PDOException “could not find driver””
I noticed somehow the following error:
PDOException “could not find driver”
The reason may be not activated pdo_mysql or not installed php5-mysql.
Let’s look at the PDO:
php -i|grep PDO
In php.ini or connected configuration files there should be a line:
extension=pdo.so extension=pdo_mysql.so
Let’s see the information about php5-mysql:
dpkg --get-selections | grep php5-mysql
If not installed, then install, in Ubuntu it can be done like this:
sudo apt-get install php5-mysql sudo apt-get install php-mysql sudo /etc/init.d/apache2 restart sudo service apache2 restart
The solution of the error “Unable to create channel of type ‘SIP’ (cause 20 – Subscriber absent)”
I noticed one time when I received a call from the Asterisk console:
dial_exec_full: Unable to create channel of type ‘SIP’ (cause 20 – Subscriber absent)
In the context of the dialplan, I make a call simultaneously to two phones:
exten => s,5,DIAL(SIP/204&SIP/203,19)
Sometimes one of the IP phones is turned off, which is why this error occurs, informing that there is no subscriber.
To solve it, you just need to turn on the IP phone.
You can see information about SIP in the Asterisk console:
asterisk -rvv sip show peers sip show peer NUMBER quit
If the client’s IP address is null and expire is -1, the SIP client is not online:
Expire: -1 Addr->IP: (null)
Comments in PHP
In PHP, comments can be of three types.
I will give an example of the first (one-line in the style of C ++):
<?php echo "TEXT"; // Comment ?>
The second one in Unix style:
<?php echo "TEXT"; # Comment ?>
The third multiline:
<?php /* Comment Comment Comment */ echo "TEXT"; ?>