Friday, 13 May 2022

Zabbix Active vs Passive Agent

When you configure Zabbix agent in the front end, there is a choice between Zabbix agent (passive) and ‘Zabbix agent (active).

For more information about how active and passive agnet works watch below video.






Tuesday, 6 July 2021

How to configure a host in Zabbix frontend

To configure a host in Zabbix frontend, Follow below steps:

  1. Go to: Configuration → Hosts
  2. Click on Create host to the right 
  3. Enter parameters of the host in the form. 
Zabbix agent configuration panel has multiple parameters which need to enter in the Front end. For details about how to add a Linux host to Zabbix Server please watch the below video.




Tuesday, 22 June 2021

How to install Zabbix Agent on Linux

A Zabbix Agent runs on various supported platforms, including Linux, UNIX and Windows, and collects data such as Memory, CPU, disk, and network interface usage from a device.

Using Zabbix-agent you can monitor CPU load, CPU utilization, Free memory, memory utilization, service status, Free disk space, and many other parameters.

For more information about the installation procedure of zabbix agent, please watch the below YouTube video.




Wednesday, 2 June 2021

How to install Zabbix Server on Ubuntu

Zabbix is the enterprise-class open-source monitoring software for various IT components including server, network, virtual machine, cloud service, database, web monitoring, service, and storage device.

For installation of the Zabbix Server on Ubuntu, please watch the below video.



Wednesday, 26 May 2021

How to upgrade ubuntu server from Ubuntu 16.04 to Ubuntu 18.04

Ubuntu 16.04 LTS becomes EOL on Apr 2021. Ubuntu supports upgrade from one LTS to the next LTS in sequential order. To upgrade a server system follow the below steps. 
  • Confirm OS version is Ubuntu 16.04 using command lsb_release –a 
  • Update all the software packages repository list and upgrade packages on the existing system using the below command. It's recommended to reboot the system after all updates are applied. 
            sudo apt-get update
            sudo apt-get upgrade -y
            sudo apt-get dist-upgrade -y
  • Install the Ubuntu Update Manager using the below command.
                    sudo apt-get install update-manager-core
  • Make sure the Prompt line in /etc/update-manager/release-upgrades is set to 'lts' if you only want LTS upgrades.
  • Upgrading to Ubuntu 18.04. To begin this process run the following command:
            sudo do-release-upgrade
  • Before making any changes the above command will first verify whether the system is ready to update or not. The user will get prompted with information about the upgrade. Press Y to continue.
  • After you enter the upgrade command, you will be asked to confirm that you want to update via SSH. Type to continue.

  • Now Ubuntu will check for the packages that need the update and gives the information about the packages which will be added, removed, and the size of the update.

  • The up-gradation process will take some time. During the up-gradation process, you may receive a prompt that will require your input. Kindly select a suitable option for you. You will have to select whether you want to install the new version of the file and overwrite the changes, keep the currently installed version, or merge the files.















  • During the upgrade, it will ask to remove obsolete software Press Y to continue.
  • After completion of the upgrade process, a system restart will be required.
  • Post restart you may verify the Ubuntu version using lsb_release –a. 

KB: https://ubuntu.com/server/docs/upgrade-introduction


Friday, 19 February 2021

How to upgrade PostgreSQL9.5 to 12

PostgreSQL9.5 is the end of life now. You can use the steps mentioned in the below video to upgrade PostgreSQL9.5 to 12.


Before upgrade please make sure sufficient disk space is available. Some extensions like. PostGIS will not be upgraded during this process. You may drop the extension from 9.5, installed it on Postgres12, and create the extension. It's recommended to take a backup before doing the up-gradation process on the production environment.
Please find the below list of commands used in the up-gradation process. # Install the repository RPM:
sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
# Install PostgreSQL9.5:
sudo yum install -y postgresql95-server
# Initialize the database and start service:
sudo /usr/pgsql-9.5/bin/postgresql95-setup initdb
# Install PostgreSQL12:
# Initialize the database and start service:
sudo yum install -y postgresql12-server
# PostgeSQL upgrade command syntax
sudo /usr/pgsql-12/bin/postgresql-12-setup initdb
# PostgeSQL Cluster compatibity check
pg_upgrade -b oldbindir -B newbindir -d oldconfigdir -D newconfigdir [option...]
/usr/pgsql-12/bin/pg_upgrade --old-bindir /usr/pgsql-9.5/bin/ --new-bindir /usr/pgsql-12/bin/ --old-datadir /var/lib/pgsql/9.5/data/ --new-datadir /var/lib/pgsql/12/data --link --check
# Upgrade Command /usr/pgsql-12/bin/pg_upgrade --old-bindir /usr/pgsql-9.5/bin/ --new-bindir /usr/pgsql-12/bin/ --old-datadir /var/lib/pgsql/9.5/data/ --new-datadir /var/lib/pgsql/12/data --link

Wednesday, 23 September 2020

Install PostgreSQL-12, pgAgent and PostGIS in CentOS 7

PostgreSQL is a free and open-source relational database management system and pgAgnet used for scheduling the job. PostgreSQL is also is known as Postgre. 

Please find the below steps to install PostgreSQL12, PostGIS, and pgAgnet in CentOS 7.

  • Update Cent OS 7 and install EPEL repo

yum update
yum install epel-release

  • Add the PostgreSQL12 Repository

You may find the repo of PostgreSQL 12 using link https://www.postgresql.org/download/linux/redhat/

yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm  

  • Install PostgresSQL12, pgAgnet and PostGIS
yum install postgresql12
yum install postgresql12-server
yum install pgagent_12
yum install postgis30_12

  • Create a PostgreSQL data directory, set permission and set a password for postgres user

By default, Postgres data directory will be initializes at location /var/lib/pgsql/12/data. In this case, we use custom data directory.

mkdir /data/PG_DATA12
chown -R postgres:postgres /data/PG_DATA12
echo "postgres" | passwd --stdin postgres

  • Initialize postgres database in a custom directory "/data/PG_DATA12"

su postgres -c "cd /usr/pgsql-12/bin/;./initdb -D /data/PG_DATA12" 

  • Enable the service

systemctl enable postgresql-12 

  • Change data directory path in postgresql-12.service

Open file postgresql-12.service which is located at /usr/lib/systemd/system/postgresql-12.service and replace "PGDATA=/var/lib/pgsql/12/data/" with "PGDATA=/data/PG_DATA12/". You may use below command also.

sed -i -e 's#Environment=PGDATA=/var/lib/pgsql/12/data/#Environment=PGDATA=/data/PG_DATA12/#g' /usr/lib/systemd/system/postgresql-12.service 

  • Reload systemd 

systemctl daemon-reload

  • Start and enable the service

systemctl start postgresql-12
systemctl enable pgagent_12
systemctl start pgagent_12 
  • Change listen address in  postgresql.conf

 sed -i -e "s/^#listen_addresses = '127.0.0.1'/listen_addresses = '*' /g" /data/PG_DATA12/postgresql.conf

 sed -i -e "s/^#listen_addresses = 'localhost'/listen_addresses = '*' /g" /data/PG_DATA12/postgresql.conf

  • Change authentication method from ident to trust in pg_hba.conf

sed -i -e "s#host    all all 127.0.0.1/32 ident#host    all all 127.0.0.1/32 trust#g" /data/PG_DATA12/pg_hba.conf

  • Restart postgresql-12 and pgagent_12 service
    systemctl restart postgresql-12
    systemctl restart pgagent_12

  • Create an extension for pgAgnet and PostGIS

psql -h localhost -p 5432 -U postgres -d template1 -c "CREATE EXTENSION postgis;"
psql -h localhost -p 5432 -U postgres -c "CREATE EXTENSION pgagent;"

  • Start service
    systemctl start pgagent_12
    systemctl start postgresql-12 

 







 

 


Tuesday, 19 May 2020

Send Email using PowerShell script

Windows PowerShell is a Windows command-line shell designed for system administrators. We can use Send-MailMessage cmdlet to send an email from PowerShell using SMTP protocol.

Copy below script in notepad, change required parameter and save it as SendMail.ps1

[System.Net.ServicePointManager]::SecurityProtocol = 'Tls,TLS11,TLS12'
$From = "Sender email address"
$To = "recipient’s email address"
$Cc = "cc recipient’s email address"
$Subject = "Your Subject"
$Body = "Message Body"
$SMTPServer = "SMTP Server address"
$SMTPPort = "SMTP Server port"
Send-MailMessage -From $From -to $To -Cc $Cc -Subject $Subject -Body $Body -SmtpServer $SMTPServer -port $SMTPPort -UseSsl -Credential (Get-Credential)

Post saving file, Open PowerShell and run command .\SendMail.ps1


It will prompt you for the login credentials.



Note : 

- This script is 100% working with gmail. You must enable less secure app or need to create app password to use this script.

How to enable less secure App in Gmail. - Click Here.
How to create App Password in Gmail. - Click Here.










Tuesday, 12 May 2020

How to install CentOS 7

CentOS media is available on centos.org. Please watch the below video to install CentOS 7.




Tuesday, 31 December 2019

Change the remote desktop port on server/desktop

RDP(Remote Desktop Protocol) is a proprietary protocol developed by Microsoft. When you connect the computer, the remote desktop feature  "listen" the connection request by default on port 3389.

You can change the RDP listening port on Windows computers/servers by modifying the registry. Use the below steps to change the default RDP port.
  • Start the registry editor (Type regedit in the Search box.) or type regedit in Run and click on OK.
  • Navigate to the following registry subkey:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\PortNumber
  • Click Edit > Modify, and then click Decimal
  • Type the new port number above 1024, and then click OK. 
  • Close the registry editor, and restart your computer/server.
After a restart, you may connect using the new RDP Port. If the firewall is running, make sure to configure your firewall to allow connections to the new port number. 

To connect the RDP using the new port, you need to enter IPADDRESS:PORT in computer address.

For security reasons, it's better to change the default RDP port and whitelist the IP address in your firewall for the RDP connection.












Thursday, 23 May 2019

How to set a Static IP Address on CentOS-7

When you install the CentOS, IP Address set to dhcp mode. The configuration file for the network interfaces located at directory /etc/sysconfig/network-scripts. 

To list the network interfaces you need to type the following command:
~]$ ip a


DHCP Configuration for ens33 stored in file ifcfg-ens33 and the same is located at directory /etc/sysconfig/network-scripts/. It's look like below.

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
NAME=ens33
UUID=d28f4e88-c167-4b78-b918-7b6e55c775e2
DEVICE=ens33
ONBOOT=yes

There are two method to Configure static IP address on ens33.

Method 1 : 
To configure a static IP address on ens33 using ifcfg file, edit file ens33-ifcfg using vi editor. File ens33-ifcfg is located at directory /etc/sysconfig/network-scripts/
~]$ vi /etc/sysconfig/network-scripts/ifcfg-ens33
Update file ifcfg-ens33 as per below

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
NAME=ens33
UUID=d28f4e88-c167-4b78-b918-7b6e55c775e2
DEVICE=ens33
ONBOOT=yes
IPADDR=172.16.16.2
PREFIX=16
GATEWAY=172.16.16.1
DNS1=8.8.8.8

Save and closed the file. Static IP Address configuration will be applied after network service restart or manually making interface down and up. You may use below command for network service restart.
~]$ systemctl restart network
To down and up network interface use below command
~]$ ifdown ens33
~]$ ifup ens33
Method 2 :
You may also configure static IP Address using NetworkManager text user interface (TUI) tool. nmtui, provides a text interface to configure networking by controlling NetworkManager.

If  NetworkManager-tui is not install, issue the following command as root:
~]# yum install NetworkManager-tui
To start nmtui, issue a command as follows:
~]$ nmtui
after using nmtui command, The text user interface appears. To navigate, use the arrow keys or press Tab to step forwards and press Shift+Tab to step back through the options. Press Enter to select an option and use Space bar toggles the status of a check box.

To set static IP address on ens33 using nmtui use below command.
~]$ nmtui edit ens33
Below windows will be open after above command



Thursday, 21 September 2017

How to find Wi-Fi password

You can find WiFi password on windows computer of currently connected WiFi network or previously connected WiFi network.

You can find the connected WiFi password using "Network and Sharing Center" or "using command prompt".

Using Network and Sharing Center

You may open Network and Sharing center by going into control panel. You can easily do this by right click on Wireless Network icon in taskbar and click on "Open Network and Sharing Center".


Now click on connected WiFi.


Click on "Wireless Properties" in "Wi-Fi Status" Window.


Click On the "Security" Tab and enable the "Show Characters (Check Box)" to view the password.




Using Command Prompt

Using command prompt you may able to find any previously connected WiFi password.
You need to open command prompt with admin rights. Then Type below command.


  netsh wlan show profiles

It will list the all previously connected WiFi network. To find the password of particular profile type below command with replacing the profilename with profile.


  netsh wlan show profile name=profilename key=clear

Above command list all setting related to particular profile. Look for the "key content" to find the WiFi password for selected WiFi Network.

Saturday, 20 May 2017

Action to be taken to avoid WannaCry ransomware

Most of people are aware about The WannaCry Ransomware Attack. Rasmoware will encrypt your files and make them inaccessible and demand a ransom payment to decrypt them. 

The ransomware, known by the names “WCry”, “WannaCry” and “WannaCryptor”, targets a vulnerability in Windows SMB service that was patched in Microsoft bulletin MS17-010 in March this year. Once WannaCry enters a network, it can spread around to other computers on that same network, a typical trait of ransomware that maximizes the damage to companies and institutions.
WannaCry has infected more than 100 countries, bringing essential businesses to a halt. It is the biggest coordinated cyber attack of its kind, impacting numerous organisations.  

Prevention is the best option to avoid such a attacks. I have listed below precaution to avoid such a attacks.
  • Patched your system/server with microsoft MS17-010 update.
  • Block the TCP port 445, 137, 138, 139 in firewall.
  • Make sure you system is updated with latest antivirus definitions.
  • Don’t open any mail in Spam or Mail which has come from Unknown Source.
  • Download software only form OEM site.
  • Turn on protected file sharing.
  • Block the TCP port 445, 137, 138, 139 in firewall.
  • Disable autorun (USB/USB).
  • Turn on popup blocker in browser.
  • Avoid giving unnecessary administrative rights to user.
For more information you may visit below sites.


Saturday, 7 January 2017

Install .NET framework 3.5 in windows 10 - Offline Method

Some application requires .net framework 3.5 to work. By default .net 3.5 framework is not install on your system. But user gets error while trying to install .net 3.5 framework from control panel using "Turn on or turn off windows feature" or some application try to download this features online and gets error due to poor internet connection.

To overcome this problem, windows has feature call Deployment Image Servicing and Management (DISM.exe) by using this you may install .net 3.5 framework. To use this feature you need the Windows 10 OS media.

To install net 3.5 framework using DISM.exe, follows below steps.
  1. Open Command Prompt as administrator. You may do this by  click All Programs, and then click  Accessories, Right-click Command prompt, and then click Run as administrator. If UAC dialog box appears then click on Yes to confirm.
  2. Now write below in cmd.


  Dism /online /enable-feature /featurename:NetFX3 /All /Source:DriveLater:\sources\sxs /LimitAccess

Where DriveLater is latter which windows assign to your windows 10 OS media.

Friday, 25 November 2016

How to start browser in kiosk mode

Chrome and Internet Explorer includes a Kiosk Mode feature that allows you to access Web pages in full-screen mode. 

How to Start Chrome in Kiosk Mode

To start Chrome in kiosk mode, you need to create shortcut for chrome. You may create shortcut by navigation to the chrome installation directory (i.e. C:\Program Files\Google\Chrome\Application) and right-click on chrome.exe. After right click do this: Send to > Desktop.

After creating a shortcut of chrome, do the below step.
  • Go to the properties of the shortcut (using right click on shortcut > properties). 
  • Suppose you want to open web site "www.digneshptl.blogspot.in" in  kisok mode. Then you need to add -kiosk www.digneshptl.blogspot.in in Target filed of the shortcut tab.

        "C:\Program Files\Google\Chrome\Application\chrome.exe" -kiosk www.digneshptl.blogspot.in



You may put this shortcut in startup to open website in full screen mode at startup.

How to IE in Kiosk Mode

To start IE in kiosk mode, open run using "Windows + R"  type the below command in the box, and then click Ok.


                  iexplore.exe -k url

e.g if you need to open website www.msn.com then command will be "iexplore.exe -k www.msn.com". You may exit kiosk mode by pressing "ALT+F4"

You may also create shortcut and put into startup. So that it will open in kiosk mode at starting of the system.

For more information about IE kiosk mode you may visit Microsoft web site.




With help of www.microsoft.com


Saturday, 25 June 2016

How to get hostname or MAC address using IP address of the system

Sometime you need to find hostname or mac address of the system for security purpose. You may find this using command "nbtstat" without physically present at required computer in your network.

To find hostname or mac address of system you must know the ip address of the system.Use below command to find

nbtstat -a IP address of the remote system

suppose you want to find hostname and mac address of  the system which is having ip address 172.16.16.16. You need to use command nbtstat -a 172.16.16.16 and output of command shown below.





Monday, 11 April 2016

How to Unhide Permanently hidden file

You may found that file in your pen-drive are not visible and your are note able to unhide the same using properties of file.

This occurs due to virus.Viruses cause different type of damage on your computer. There are some viruses that will encrypt your file so you are force to buy the decryption key form the programmer. This type of virus knows as ransomware. There is another type of virus which will hide your file and folder by setting the hidden and system attributes to the files.

To see Hidden Files, Folder Do Following steps
  1. Go to Control Panel > Folder Options
  2. Now in Folder Options go to View Tab.
  3. Now Select "Show hidden Files, Folders and Drives" radial button and also Uncheck "Hide protected operation system files".
  4. Then click on Apply and Ok Button.

To change attributes of permanently hidden file or folder windows  have a attrib command. Syntax of attrib command as below.

 ATTRIB [+R | -R] [+A | -A ] [+S | -S] [+H | -H] [+I | -I]
       [drive:][path][filename] [/S [/D] [/L]]

  +   Sets an attribute.
  -   Clears an attribute.
  R   Read-only file attribute.
  A   Archive file attribute.
  S   System file attribute.
  H   Hidden file attribute.
  I   Not content indexed file attribute.
  [drive:][path][filename] Specifies a file or files for attrib to process.
  /S  Processes matching files in the current folder and all subfolders.
  /D  Processes folders as well.
  /L  Work on the attributes of the Symbolic Link versus the target of the Symbolic Link

eg suppose virus permanently hide file or folders in your Drive. Then you can use following command. To run this command you have to run command prompt with administrative privilege.

"attrib -S -H  [drive:][path][filename] /S /D"













Tuesday, 22 March 2016

Set IP Address using command in Windows

Some times require to set large number of static IP address in your company. Rather than setting it manually we can use batch file using "netsh"  command to set IP. After that you need to change IP address in batch file and run it on another Computer. "netsh" is windows utility which allows local and remote configuration of network devices. You can use below command to set IP address.

ipconfig /flushdns
ipconfig /release
netsh interface ip set address "Local Area Connection" static 10.195.82.113 255.0.0.0 10.195.82.1
netsh interface ip set dns name="Local Area Connection" static 8.8.8.8
netsh interface ip add dns name="Local Area Connection" 8.8.4.4  index=2
netsh interface set interface "Local Area Connection" disable
netsh interface set interface "Local Area Connection" enabled

where IP Address is 10.195.82.113 Subnetmask :255.255.0.0 Gateway:10.195.82.1 Primary DNS:8.8.8.8 and Secondary DNS is : 8.8.4.4

You may download script file from Here

Saturday, 12 March 2016

Find Lost Android Cell Phone Easily

Google’s makes easier to find your misplaced cell phone. To use this feature you need to enable location service in your android mobile and add your device to Android Device Manager in Google. You may use Android Device Manager to find mobile. Now Google has introduced new query to find your phone.  You need to just fire a query in Google Search box after login in to google account. The query is Where is my phone?.



With help of google power searching and advanced power searching.

Saturday, 26 September 2015

Download YouTube video online

Its very simple to download YouTube video without any video downloading software. To download video follow below step.
  • Browse for the video, you want to download.
  • Copy full URL of video and paste it in savefrom.net website. Now click on download button and video downloading will start.