Thursday, April 10, 2014

Cacti Graph does not display

Problem :

Suddenly cacti has stopped drawing graph.

Analysis :

Log into the server and checked the cacti log.
Cacti has generated errors in /usr/share/cacti/log/cacti.log


Error log in cacti.

04/09/2014 04:40:03 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1017', SQL:"insert into poller_output (local_data_id, rrd_name, time, output) values (128, 'mem_free', '2014-04-09 16:40:03', '2554360')'
04/09/2014 04:40:03 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1017', SQL:"insert into poller_output (local_data_id, rrd_name, time, output) values (127, 'load_5min', '2014-04-09 16:40:03', '0.00')'
04/09/2014 04:40:03 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1017', SQL:"insert into poller_output (local_data_id, rrd_name, time, output) values (126, 'load_15min', '2014-04-09 16:40:03', '0.00')'
04/09/2014 04:40:03 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1017', SQL:"insert into poller_output (local_data_id, rrd_name, time, output) values (123, 'cpu_system', '2014-04-09 16:40:03', '34305')'
04/09/2014 04:40:03 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1017', SQL:"insert into poller_output (local_data_id, rrd_name, time, output) values (122, 'cpu_nice', '2014-04-09 16:40:03', '19')'
04/09/2014 04:40:03 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1017', SQL:"insert into poller_output (local_data_id, rrd_name, time, output) values (58, 'traffic_out', '2014-04-09 16:40:03', '348607')'
04/09/2014 04:40:03 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1017', SQL:"insert into poller_output (local_data_id, rrd_name, time, output) values (58, 'traffic_in', '2014-04-09 16:40:03', '3948566')'

Root cause & Resolution :

The table “poller_output” in cacti database has corrupted. I've logged into the database and try to repair the table. Issue below commands.

Mysql > use cacti;
mysql > truncate table poller_ouput;

Then restarted the services apache and mysql. After a while graph is displayed and draw accordingly.

Tuesday, March 18, 2014

mod_rewrite does not overwrite properly

If your server does not rewrite properly then check the SELINUX property. This is for CentOS server. 
If it's set to permissive or enable then apache mod_write does not work properly. 

You should set the selinux to disabled mod and reboot the server. Then it should work fine. 

Tuesday, March 11, 2014

Time not showing in Roundcube. ( Date column is blank)

When you installed Roundcube Mails are showing properly but the time of emails do not show.
This issue occurred due to php.ini file configuration.

You need to set correct time zone in the php.ini file.
vi /etc/php.ini
date.timezone = "UTC"

 then restart the apache service. That's all. Enjoy it.  

Monday, November 11, 2013

Wired Network Unstable with Ubuntu 13.04

I have installed 13.04 64bit OS in Toshibha laptop. I have connected the Wired network but the issue is that connection is getting drop time to time even Network stayed connected.
I could not ping to the gateway. Then I have restart the network but the problem remain same. After physically unplugged & plugged the cable,the network is back to normal. But the issue is that this can not be done frequently.
So to overcome this issue I have followed the below step.
  1. Found out that this issue is due to kernel bug in 3.8 version.
  2. Then I have gone for a kernel upgrade to version 3.10, to do that use the below commands.
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.10.12-saucy/linux-headers-3.10.12-031012-generic_3.10.12-031012.201309141044_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.10.12-saucy/linux-headers-3.10.12-031012_3.10.12-031012.201309141044_all.deb

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.10.12-saucy/linux-image-3.10.12-031012-generic_3.10.12-031012.201309141044_amd64.deb
sudo dpkg -i linux-headers-3.10.12-*.deb linux-image-3.10.12*.deb
Then Restart the computer.

After the reboot I have make ping to gateway and worked as usual. Continuously for 2 hours able to ping to gateway. So this is the way to solve the instability of network connection issue in Ubuntu 13.04 OS.

Tuesday, August 6, 2013

Peer to Peer communication in FreePBX

This document pointing out the Direct RTP media or peer to peer communication of RTP.

I have managed to get Asterisk not to proxy media. I am running Freepbx 2.10.1.9 and Asterisk 1.8.12.0 on CentOS Linux 5.7 (Linux 2.6.18-274.3.1.el15.i686 - 32-bit) in Virtual machine. Directly connected to static IP.

It can be done under below conditions.
    --> NAT should be disabled in the FreePBX ( sip.conf, Extension)
    --> Network Devices and Phones should support for peer to peer communication (NO NAT)
    --> In the extensions recording features should be turned off.
    --> Should havedirect internet connection with static IP address

Setting changes in the SIP server, this is should be done via freepbx GUI
    1) Application -> Extensions -> 'canreinvite=yes' and 'nat=no'
    2) Settings -> Asterix SIP settings -> 'NAT=no' and 'IPconfiguratoin=static IP' and 'Reinvite Behavior=yes'
    3) Add below entries to Other SIP Settings
        --> 'directrtpsetup=yes' and
        --> 'keepalive=yes'
    4) Settings -> Advanced Settings -> "SIP canrenivite (directmedia)=yes" and "SIP nat=no"
    5) Settings -> General Settings -> "Asterisk Dial command options:" should be empty


I have used tcpdump tool to monitor the communicatoin between server and SIP phones. Then I were albe to recognized the peer to peer communication.




Reference : http://www.dslreports.com/forum/r27852319-Can-I-get-Asterisk-to-not-proxy-media-

Friday, June 7, 2013

check_mailq not correctly detecting the mail queue -NRPE plugins


I have added nagios NRPE client to check mail queue in CentOS 6 server and running postfix as mail deamon.

Issue : Eventhough there is mailq in the server nagios showed as Empty mailq.


First I checked the below configuration files in the Mail server
--> /usr/local/nagios/libexec/check_mailq : There you can find a variable called
"$mailq = 'sendmail'; # default". I have changed it to postfix. But it didnt resolve the issue.
--> /usr/local/nagios/libexec/utils.pm : There you can find a varialbe called $PATH_TO_MAILQ   = "/usr/bin/mailq";
This is also correct. That can checked by issue /usr/bin/mailq and it will show the actual mailq
--> /usr/local/nagios/etc/nrpe.cfg : There you set check_mailq parameteres
/usr/local/nagios/libexec/check_mailq -w 100 -c 200

Run the below command independantly in the mail server
--> /usr/local/nagios/libexec/check_mailq -w 100 -c 200
But it issues the Mail queue empty though there are several mails in the queue.

Then I issued the above command with the mail deamon option as below
--> /usr/local/nagios/libexec/check_mailq -w 100 -c 200 -M postfix
This will show you the correct mail queue and then I chaged the /usr/local/nagios/etc/nrpe.cfg check_mailq parameter with the -M postfix option.
Issue was sorted.

Note : AS far as I found the postfix does not create mailqueue directory under /var/spool/. It has seperate direcotry in /var/spool/postfix/ which maintain mails in seperate directories such as  deferred , bounce , active  etc. So this might be the reason the nagion NRPE plugin could not check the mail queue correctly.

Some of the packages cannot updated. Need to take from old packages.


Ubuntu apt-get install propagate error message “ Some of the packages cannot updated. Need to take from old packages. - Ubuntu OS version is old.”


When you get this kind of error message first you need to backup /etc/apt/souces.list and then follow the below mention steps.

  1. vi /etc/apt/sources.list
  2. Then find the below lines and replace as mention
  • deb <siteurl> karmic main restricted
  • replace the <siteurl> with http://old-releases.ubuntu.com/ubuntu
3. Once again find http://security.ubuntu.com/ubuntu and replace with http://old-releases.ubuntu.com/ubuntu

4. Save the changes and issue the below command.
5. apt-get update

Then install the packages as you wish.