Thursday 26 March 2015

How to Add Host in Zabbix Server to Monitor

Original post: http://tecadmin.net/add-host-zabbix-server-monitor/

After installing Zabbix Server and Zabbix Agent, lets move to add your first host in Zabbix monitoring. There are Zabbix is template rich tools, It contains lots of pre defined templates which we can easily used with our hosts.
There are two ways to add hosts in Zabbix:
1. Zabbix has capability to scan your network and automatically add all the hosts in Zabbix server.
2. Second method is used for adding hosts manually.
Using this tutorial, we are going to add host manually. Follow the below steps to add your first host which is running with Linux operating system.

Adding New Host in Zabbix

Firstly we need to login to zabbix web interface using admin account.
After login follow the steps given below, You may also refer screenshot showing just after these steps.
  • Click on Configuration Menu
  • Click on Hosts submenu
  • Click on Create Host button at right side
add-zabbix-host-1
Now fill the following details of remote host and go to Templates tab.
  • Enter Hostname: Hostname of Remote system
  • Visible name: Name to be display in zabbix
  • Group: Select the desired group for you host
  • Agent interface: Fill the info of Zabbix agent running on host
  • Status: Select initial status
add-zabbix-host-2
  • Click on add link
  • Select desired Template : Please select carefully, Because it will enabled all checks for the host
  • Click on save button
add-zabbix-host-3
add-zabbix-host-4
Congratulation! You have added first host for zabbix monitoring. Repeat the same task for other hosts too.

How to View Graph in Zabbix

Graphs are always attracted the new users, Below screenshot will help you to how to view graphs in zabbix. If you have just added the host, you need to wait for few time, so that zabbix can collect some data from remote host to show on graph.
graph-network
Thank You for using this article, if this tutorial helps please do forgot to share it with your friends.
Use below link to read more about zabbix configurationhttps://www.zabbix.com/documentation/2.0/manual/config

How to Install Zabbix Agent on CentOS/RHEL 7/6/5

Original post: http://tecadmin.net/install-zabbix-agent-on-centos-rhel/

Zabbix Agent is required to install on all remote systems needs to be monitor through Zabbix server. The Zabbix Agent collects resource utilization data and applications data on client system and provide such information to Zabbix server on there requests.

There are two types of checks between Zabbix Server and Client.
·         Passive Check : Zabbix Agent sent data to server on there request.
·         Active Check : Zabbix Agent sends data periodically to Server.

After installing zabbix server on your server, Now we are moving to install agent on remote system’s. This article will help you to install zabbix agent on CentOS/RHEL 7/6/5 systems. After completing this step go to next article add Host in Zabbix Server.

Installing Zabbix Agent
Follow the below instructions to install Zabbix Agent on CentOS, RHEL 7/6/5 systems.

Step 1: Add Required Repository

Before installing Zabbix Agent first configure zabbix yum repository using following commands as per your required version and operating system.

CentOS/RHEL 7:

# rpm -Uvh http://repo.zabbix.com/zabbix/2.2/rhel/7/x86_64/zabbix-release-2.2-1.el7.noarch.rpm

CentOS/RHEL 6:
# rpm -Uvh http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-release-2.2-1.el6.noarch.rpm

CentOS/RHEL 5:
# rpm -Uvh http://repo.zabbix.com/zabbix/2.2/rhel/5/x86_64/zabbix-release-2.2-1.el5.noarch.rpm


Step 2: Install Zabbix Agent


After installing yum repository packages in our system. Now use following command to install Zabbix agent on your Linux sytem.

# yum install zabbix zabbix-agent nano –y


Step 3: Update Zabbix Agent Configuration


As zabbix agent has been successfully installed on our remote system. Now we just need to configure zabbix agent by adding zabbix server ip in its configuration file /etc/zabbix/zabbix_agentd.conf

sed -i 's/Server=127.0.0.1/ Server=192.168.1.11/g' /etc/zabbix/zabbix_agentd.conf

Or

nano /etc/zabbix/zabbix_agentd.conf

#Server=[zabbix server ip]
#Hostname=[ Hostname of client system ]

Server=192.168.1.11
Hostname=Server1


Step 4: Restarting Zabbix Agent


After adding zabbix server ip in configuration file, now restart agent service using below command.

service zabbix-agent stop
service zabbix-agent start

To start and stop zabbix-agent service anytime use following commands.

# service zabbix-agent start
# service zabbix-agent stop


Step 5: Add to autostart 


chkconfig zabbix-agent on


Step 6: Add to firewall


firewall-cmd --permanent --zone=public --add-port=10050/tcp
firewall-cmd --permanent --zone=public --add-port=10050/udp
firewall-cmd --reload

Monday 23 March 2015

Install Sails js Centos

1. Install nodejs and npm
2 Update npm
3 install sails
4. add nginx config for sails : (http://blog.saitov.me/2015/02/configure-sailsjs-expressjs-to-run-with.html)

yum install -y nodejs nmp
npm install -g npm
npm install -g sails grunt grunt-cli pm2 jade 



Install steps Centos 7

Have to do:

yum install epel-release -y
cd /
yum install -y wget mc sshpass unzip nano git
yum update -y

2  Disable Selinux:
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
setenforce Permissive

3. Change ssh port: http://blog.saitov.me/2015/03/centos-7-rhel-7-change-openssh-port.html


Optional:
nginx: http://blog.saitov.me/2015/02/install-nginx-on-centos-7.html
yii: http://blog.saitov.me/search/label/YII
Sails js: http://blog.saitov.me/search/label/sails



Add. repositories:

cd /tmp && wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
sudo rpm -Uvh remi-release-7*.rpm
cd /tmp && wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
sudo rpm -Uvh rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm

Sunday 22 March 2015

EMFILE, Too many open files - Set ulimit parameters


I have a problem - got error for Sails js

EMFILE, Too many open files 

By default the number of open files  pro user in Centos  is 1024. In my case this number was  too small so I have to increase it.This is done with the  ulimit command:
$ulimit -a   # see all the kernel parameters
$ulimit -n   #see the number of open files
$ulimit -n 9000  #  set the number open files to 9000
The problem with this way is that the ulimit parameter is only set currently  for this command terminal and user.If you open a new tab and type again ulimit -a you will see that the number of open files is 1024.This means that after a reboot you’ll need to set the parameter again.
1.  First, in order to set this options automatically  you have to edit the etc/security/limits.conf file.
$sudo gedit /etc/security/limits.conf    #open the file in gedit
The # means that this part is commented.The wildcard * means  for all users.We need to set the nofile option meaning maximum number of open files.If you want to change the number of files of user, you should add this line in the limits.conf:
user  soft  nofile 9000
user  hard  nofile 65536
If  you want to set the nofile only for superuser you just write root instead of user.
root soft  nofile 9000
root hard  nofile 65536
2. Second step: 

Added to /etc/sysctl.conf:
fs.file-max = 65536

Then re-read the sysctl.conf:
/sbin/sysctl -p

Wednesday 11 March 2015

Tools I liked

  1.  TCP Port Scan with Nmap  - scan ports, port ranges, ...
  2. JSON Viewer - simple and do all u need (Other one )
  3. HTML Formatter - good one
  4. YUI Compressor Online JavaScript/CSS - well known YUI Compressor online
  5. https://temp-mail.org  /  10minutemail.com - super mail for one time registration / entrance
  6. JsConsole.com - remote js console window
  7. diawi.com - great a tool for iOS developers to deploy Development and Ad hoc iOS applications directly to the device
  8. Javascript jsbeautifier  - Online fomatter Javascript / HTML
  9. XShell  - super ssh / telnet /sftp client
  10. ICO creator online - png to ico convertor
  11. HTML 2 Jade  - onlne convertor
  12. Jade 2 HTML - onlne convertor
  13. Icons / Glyphs generator - webhostinghub.com/glyphs/
  14. Clink  Linux like Windows Cmd
  15. GoAccess - real-time web log analyzer (IIS, nginx, etc)
  16. XnView Image Viewer - my preferred
  17. Get UDID of IPHONE
  18. ConEmu -   Super console for Windows, with full screen, Linux-like goods
  19. Image to css data uri (embedded image ) - A simple utility to convert an image into base 64 data URIs for embedding images.
  20. nvm-windows - node.js version management
  21. WinCDEmu - CD/DVD/BD emulator Open source
  22. cmder.net - Super console for Windows -  ConEmu + Clink

Tuesday 10 March 2015

CentOS 7 / RHEL 7 : change OpenSSH port number ( SELINUX enabled )

Original post: http://sharadchhetri.com/2014/10/15/centos-7-rhel-7-change-openssh-port-number-selinux-enabled/

CentOS 7 / RHEL 7 : change OpenSSH port number ( SELINUX enabled )