Snappy

Helpdesk Support

Official Supportmonk Company Blog!

Know which vps is having the process running on by standing in main Node.

February 28, 2018 , 10:08 am


 

 

 

We know about Hardware Node and small vps servers inside it. We usually think, regarding to know about what all process running in vps only after entering into that particular VPS.

Using command vzpid you can know from Node, which VPS of that node the process is running on and what process is it. Get the process ID from node and try it with command vzpid.

vzpid pid

You will get result like as follows:

Pid VEID Name
22620 182 clamd

 

Flush DNS cache in cPanel server

February 28, 2018 , 10:07 am


Run the command ‘rndc flush’ in shell

Broken Grub

February 28, 2018 , 10:01 am


It is also possible to use the grub command to install the boot loader, but not the Grub files in /boot/grub. This can be useful to repair a Grub installation if the boot loader was overwritten or damaged.

  1. Do grub.

  2. Optionally, do find /boot/grub/stage1 to find which partitions have the required Grub files in /boot/grub. If you have a separate partition for /boot, do find /grub/stage1 instead.

  3. Do root [partition using Grub convention] to indicate the partition which has the Grub files in /boot/grub and the /boot/grub/grub.conf configuration file.

  4. Install the boot loader using setup [location of boot loader using Grub convention].

  5. Do quit to leave the Grub programme.

 

 GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename.]

grub> find /boot/grub/stage1
 (hd0,5)
 (hd0,9)

grub> root (hd0,5)
 Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  15 sectors are embedded.
succeeded
 Running "install /boot/grub/stage1 (hd0) (hd0)1+15 p
(hd0,5)/boot/grub/stage2
/boot/grub/grub.conf"... succeeded
Done.

grub> quit

 

That’s it

CHECK_NRPE: Error – Could not complete SSL handshake.

February 28, 2018 , 9:44 am


If you find this error in nagios for a particular server, this means nothing but the nrpe check from nagios server cannot able to complete the service check to client server.

You can check this through command line itself, run the following in nagios server.

# /usr/local/nagios/libexec/check_nrpe -H hostname/clientserverIP -c check_load
CHECK_NRPE: Error – Could not complete SSL handshake.

You may need to cover different scenarios for this to troubleshoot.

1) Check if the particular check is available in client server (For example, check_load, 3ware_check, mail_count etc)

2) Check if xinetd or nrpe stopped running,otherwise try to restart it.

# /etc/init.d/xinetd restart
# /etc/init.d/nrpe restart

3) Make sure you allowed the nagios IP in /etc/xinetd.d/nrpe if nrpe is running under xinetd,like as getting in netstat result.

# netstat -plan | grep :5666
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN 25022/xinetd

Check the parameter “only_from” in this file whether allowed nagios IP there.

Then restart xinetd

# /etc/init.d/xinetd restart

OR

Make sure you allowed the nagios IP in /etc/nagios/nrpe.cfg if nrpe is not running under xinetd and as nrpe user itself, like as getting in netstat result.

# netstat -plan | grep :5666
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN 248184/nrpe

Make changes to value of parameter “allowed_hosts” in /etc/nagios/nrpe.cfg to as shown below

allowed_hosts=127.0.0.1,nagioserverip

Then restart nrpe

# /etc/init.d/nrpe restart

4) Try to whitelist nagios server IP in firewall.

OpenVZ vps creation “Error in check_mount_restrictions (ploop.c:1627)”

February 28, 2018 , 9:34 am


We won’t  be able to create new vps in node due to following ploop error.

From the log (/var/log/vzctl.log)
—————————
Creating image: /vz/private/350.tmp/root.hdd/root.hdd size=2306867K
Creating delta /vz/private/350.tmp/root.hdd/root.hdd bs=2048 size=4614144 sectors v2
Storing /vz/private/350.tmp/root.hdd/DiskDescriptor.xml
Error in check_mount_restrictions (ploop.c:1627): The ploop image can not be used on ext3 or ext4 file system without extents
Failed to create image: Error in check_mount_restrictions (ploop.c:1627): The ploop image can not be used on ext3 or ext4 file system without extents [21]
Destroying container private area: /vz/private/350
Creation of container private area failed

—————————

Check whether the partition is on ext4 filesystem or not. Ploop doesn’t work on ext3 filesystem. My node’s /vz partition was on ext3 filesystem.

We cannot simply upgrade the /vz partition from ext3 to ext4 as lots of vps are running on it. Here I have checked the vzctl version and found it was latest one 4.7.x

# vzctl --version
vzctl version 4.7.1

The latest vzctl tries to create template as ploop which is advanced than simfs. Since the partition runs on ext3 filesystem, the safest way to fix the issue is to downgrade the version of vzctl to 4.5.x

version 4.5.1 is not available in openvz anymore. You may need to manually download the rpm of vzctl and vzctl-core from https://openvz.org/Download/vzctl/4.5.1 and install it.

Before installing it, remove the current vzctl 4.7.x

# yum remove vzctl
# cd /usr/src
# wget http://download.openvz.org/utils/vzctl/4.5.1/vzctl-4.5.1-1.x86_64.rpm
# wget http://download.openvz.org/utils/vzctl/4.5.1/vzctl-core-4.5.1-1.x86_64.rpm

# rpm -Uvh vzctl-core-4.5.1-1.x86_64.rpm
Preparing… ########################################### [100%]
1:vzctl-core ########################################### [100%]

# rpm -Uvh vzctl-4.5.1-1.x86_64.rpm
Preparing... ########################################### [100%]
1:vzctl ########################################### [100%]
vz-postinstall: /etc/sysctl.conf: add net.bridge.bridge-nf-call-ip6tables = 1
vz-postinstall: /etc/sysctl.conf: add net.bridge.bridge-nf-call-iptables = 1
#

vzctl --version
vzctl version 4.5.1

Create container now :

vzctl create 101 --ostemplate centos-6-x86_64-cpanel --private /vz/private/101 --root=/vz/root/101 --config configname
Creating container private area (centos-6-x86_64-cpanel)
Performing postcreate actions
CT configuration saved to /etc/vz/conf/101.conf
Container private area was created

Syncing your mailbox folders using ImapSync

February 22, 2018 , 9:24 pm


The imapsync  is a handy tool we can use to sync our inbox folders.
The uniqueness of this tool is that it can sync folders between two imap servers directly without any backup/restore or intermediate mail clients.

Installing ImapSync

For Fedora & Centos distros,

sudo yum install epel-release
sudo yum install imapsync

For Ubuntu

For ubuntu unfortunately the repository is not available and you have to type the following commands

sudo apt-get install makepasswd rcs perl-doc libio-tee-perl git libmail-imapclient-perl libdigest-md5-file-perl libterm-readkey-perl libfile-copy-recursive-perl build-essential make automake libunicode-string-perl libauthen-ntlm-perl libcrypt-ssleay-perl libdigest-hmac-perl libfile-copy-recursive-perl libio-compress-perl libio-socket-inet6-perl libio-socket-ssl-perl libio-tee-perl libmodule-scandeps-perl libnet-ssleay-perl libpar-packer-perl libreadonly-perl libterm-readkey-perl libtest-pod-perl libtest-simple-perl libunicode-string-perl liburi-perl cpanminus

#Install modules from CPAN

sudo cpanm JSON::WebToken Test::MockObject Unicode::String Data::Uniqid

#Get the imapsync from  git repository

git clone git://github.com/imapsync/imapsync.git

 

#Build and install

cd imapsync
mkdir dist
sudo make install

Transfer emails wih ImapSync

You have to ensure that both imap servers are up and running.

After that you can ensure the following command syntax

imapsync --host1 hostname1 --port1 port# --user1 #1 --domain1 fully.qualified.domain #1 --ssl1 --host2 hostname2 --port2 port# --user2 userid#2 --domain2 fully.qualified.domain #2 --ssl2

 

e.g.;

For syncing mails from imap.imapserver.net to localhost,

imapsync --host1 imap.imapserver.net --user1 [email protected] --password1 4HrJazz1! --host2 localhost --user2 [email protected] --password2 4DrJazz1!

 

If you don’t want to give passwords directly in terminal which will be shown in the ps command,
it’s better to create two files (/etc/secret1 and /etc/secret2 in this example) that contain the passwords , do a chmod 600 on these files, and use the –passfile1 and –passfile2 switches.

echo “4HrJazz1!” > /etc/secret1
echo “4HrJazz1!” > /etc/secret2
chmod 600 /etc/secret1
chmod 600 /etc/secret2

Now we can do the migration with this simple command:

imapsync --host1 imap.imapserver.net --user1 [email protected] --passfile1 /etc/secret2 --host2 localhost --user2 [email protected] --passfile2 /etc/secret2

 

How to Disable Network Manager

February 20, 2018 , 5:31 pm


The Network Manager service automates the network’s settings and disrupts connections to the IP addresses that reside in the ipaliases module.

 

Disable the Network Manager service

To disable the Network Manager service, perform the following steps:

1.) Disable Network Manager with the following commands:

Disable NetworkManager on CentOS 6, CloudLinux 6, Red Hat Enterprise Linux 6 (RHEL),

    service NetworkManager stop
    chkconfig NetworkManager off
Disable NetworkManager on CentOS 7, CloudLinux 7,
systemctl stop NetworkManager.service
systemctl disable NetworkManager.service
2.) Change to the /etc/sysconfig/network-scripts directory.
     Open each configuration file with your preferred text editor and set the following keys’ values:

    NM_CONTROLLED=no

    ONBOOT=yes
3.) Run the following commands to restart the network:
      Restart the network on CentOS 6, CloudLinux 6, RHEL 6
  chkconfig network on
  service network start
Restart the network on CentOS 7, CloudLinux 7, or RHEL 7
  systemctl enable network.service
  systemctl start network.service

ToubleShoot High Disk I/O

February 20, 2018 , 5:13 pm


Disk I/O describes how long the read and write operations require on a hard disk. The speed at which your server can read and write information to disk directly affects your server’s performance and the performance of cPanel & WHM.  Your server’s load will increase if the system experiences high disk I/O wait time.

 

Symptoms of high disk I/O

Problem
Description
High server load The average system load exceeds 1.
chkservd notifications You receive notifications about an offline service or that the system cannot restart a service.
Slow hosted websites Hosted websites may require more than a minute to load.
Slow delivery of email The Exim service performs slowly or does not respond. Exim contains a large outbound mail queue.
Slow connection for email The POP or IMAP services perform slowly or do not respond.
Slow Webmail interfaces The Webmail interfaces perform slowly or do not respond (for example, Roundcube, Horde, or SquirrelMail).
Slow WHM or cPanel interfaces The WHM or cPanel interfaces perform slowly when you add email accounts, databases, or other items.

How to determine the disk I/O wait on your server

Use the top command to find the average wait time on your server

The %wa statistic at the top of the output indicates your server’s average disk wait.

If the I/O wait percentage is greater than one divided by the number of your CPU cores, the CPU cores must wait to process data on hard disk. For example, if the system possesses four CPU cores and the server %wa statistic is 8.0, then the actual %wa is 2.0. Because the actual %wa is larger than 1.0, the CPU cores must wait before they can process data on hard disk.

Use the sar command to determine the history of your server’s disk I/O wait

The sar command provides you with the history of the server’s load averages. Use this command to determine the times when your server experiences high disk I/O.

How to resolve a problem with high disk I/O

Problem
Recommendation
Hard disk specifications with low RPM speed or slow interface technology Upgrade the hard disk on your server or split the application load between separate hard disks.
No bandwidth available on the hard disk Upgrade the hard disk on your server or split the application load between separate hard disks.
Write caching is disabled Enable write caching on the disk.
Degraded RAID array Check the Raid array for a hardware malfunction. You should test and verify the hardware.
Software RAID array on the server reports busy; CPU uses slow parity calculation Check the Raid array for a hardware malfunction. You should test and verify the hardware.
Software processes slowly Upgrade the hard disk on your server or split the application load between separate hard disks.

Changing container ID in Openvz servers

June 9, 2017 , 11:51 am


I was migrating one container from machine to another and accidentally i found that there are two similar container ID on the two machines e.g. 101 on both machines. Migration does not allow migrating a container if the same ID on the other machine exists.

I followed the steps below to change CTID from 101 to 102:


[email protected]# vzctl chkpnt 101 –dumpfile /tmp/Dump.101
[email protected]# mv /etc/vz/conf/101.conf /etc/vz/conf/102.conf
[email protected]# mv /vz/private/101 /vz/private/102
[email protected]# mv /vz/root/101 /vz/root/102
[email protected]# vzctl restore 102 –dumpfile /tmp/Dump.101

 

That’s all, now I’ve changed the container ID of VM from 101 to 102.

Paper Lantern showing set but showing x3 style in cPanel

June 9, 2017 , 11:50 am


As you know cPanel has stopped x3 theme and made paper lantern the default style, they have introduced “Retro Style” for Paper Lantern.  The Retro style makes Paper Lantern look like X3 so that if you prefer the old and trusted appearance of X3, you can feel at home even when using Paper Lantern.  It’s not a perfect implementation of X3, but with the silver chrome borders, blue-teal gradients, electro-blue world map page headers, and bubbly application icons, Paper Lantern can have the same familiarity that so many of our customers crave. Some might get confused as why cpanel shows X3 look even with Paper lantern enabled.

You can  switch to Default Style of Paper lantern for those accounts which have Retro Style enabled by following method :

#cd /home/$user/var/cpanel/styled    (replace $user with cPanel username)
In the Styled directory if you list the files you will see a link as blow:

# ls -l 

lrwxrwxrwx 1 $user $user 58 Apr 27  2016 current_style -> /usr/local/cpanel/base/frontend/paper_lantern/styled/retro/

Just unlink current_style and it rolls back to default style of paper lantern.

# unlink current_style
Now re-login to your cPanel account and you will see the default sPaper lantern Style.

Outsourced Customer Support