Google Cloud basics: Activate Cloud Shell

Introduction Google CLoud like it’s popular contemporary cloud vendors offers a means to manage cloud resources via the command line. The folks at GCP refer to this command line interface as cloud shell and it uses the gcloud sdk. One of the benefits of using cloud shell is that it can be launched directly from the Google Cloud console. In this post, we’ll demonstrate how to familiarize yourself with cloud shell while explaining some Google Cloud terminology along the way. Activate Cloud Shell Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB home directory and runs on the Google Cloud. Cloud Shell provides command-line access to your Google Cloud resources. In the Cloud Console, in the top right tool bar, click the Activate Cloud Shell button and click Continue when prompted. It takes a few moments to provision and connect to the environment. When you are connected, you are already authenticated, and the project is set to your PROJECT_ID. What is a project? Any Google Cloud resources that you allocate and use must belong to a project. You can think of a project as the organizing entity for what you’re building. A project is made up of the settings, permissions, and other metadata that describe your applications. Resources within a single project can work together easily. gcloud is the command-line tool...

Read More

Create persistent swap partition on Azure Linux VM

Introduction Swap space is storage on a disk device that is used when the system’s RAM (physcial memory) is full. When a Linux system runs out of RAM, inactive memory pages are moved from the RAM to the swap space. Swap space can take the form of either a dedicated swap partition or a swap file. It is recommended that the swap space should reside on a dedicated partition and a swap file should be used as a last resort. This article is not a deep dive on swap space in Linux but we did want to refresh the concept of it. In this post, we will explain how we could create swap space on a Linux VM on Azure cloud that would persist across a reboot. The swap partition created using the standard methods may not persist after a machine reboot, for a Linux virtual machine hosted in Microsoft Azure environment. Microsoft Azure, however, provides the option to create a swap partition on the VM, using the /dev/sdb partition and WAAGENT service. The WAAGENT service is an Azure Linux agent for Microsoft Azure environment and will be present in Azure Linux virtual machines by default on each VM. The /dev/sdb partition is an ephemeral partition i.e. the data stored in this partition will be lost after each machine reboot. So we can make use of this partition as...

Read More

DNF, YUM and RPM package manager comparison

Introduction We have been using the yum or rpm package management tools for a while for managing packages in Redhat, Centos and other distributions which have been forked from RHEL. Yum has been the default package manager since Redhat Enterprise Linux 5 onwards. Before yum, RHEL systems had been using the up2date software management program. The DNF package manager was introduced in Fedora 18 and became the default package manager for the Fedora distribution for operating system version Fedora 22 onwards and is intended to be a replacement for yum. In this article, we will compare these package managers to provide some perspective as to when and why you should consider using one over the other.   Sno                    DNF               YUM                                     RPM 1 Written in C and Python Written in python Written in C and Perl 2 DNFs uses libsolv for dependency resolution which was created and maintained by SUSE YUM uses public API for dependency resolution RPM does not provide dependency resolution 3 Dependency resolution is fast and easy making installation of groups of packages very simple Dependency resolution is slower as compared to dnf but is still fairly straightforward Due to lack of dependency...

Read More

Introduction to the aptitude package manager for Ubuntu

Introduction In our ongoing series of articles covering various software management tools, we have already covered, dpkg,apt-get and apt. In this article, we’ll cover the aptitude tool for package management on our Ubuntu 16.04 system. The aptitude command is a very useful, text-based utility for managing packages on your server.  Some administrators use it as an alternative to apt.  The aptitude package management software provides a command line utility named aptitude but a powerful text user interface as well. The TUI displays a list of software packages and allows the user to interactively pick packages to install or remove. The aptitude text user interface is based on the curses computer terminal library, with which it provides an interface that incorporates some elements commonly seen in graphical user interfaces (GUIs). Given below are some of the useful features of aptitude: a mutt-like syntax for matching packages in a flexible manner mark packages as “automatically installed” or “manually installed” so that packages can be auto-removed when no longer required colorful preview of actions about to be taken dselect-like persistence of user actions the ability to retrieve and display the Debian changelog of most packages AptCLI-like (= apt-get + apt-cache) command line mode Score-based and (usually) smarter dependency resolver than apt-get   Installing aptitude: The aptitude software is not installed on the system by default. We can install it by using the...

Read More

zypper package management tool examples for managing packages on SUSE Linux

Introduction The zypper package management tool performs the same function for SUSE Linux as yum and apt perform for RedHat and Debian based systems respectively. SUSE (Software and System Entwicklung (Germany) meaning Software and System Development, in English) Linux runs on top of the open-source Linux kernel. The SUSE Linux distribution is available in two variants, a community-driven project named OpenSUSE and a commercial version named SUSE Linux Enterprise. Zypper and YaST are the two command line tools used for package management in OpenSUSE and SUSE Enterprise Linux platforms. Both tools work on top of RPM. Zypper uses the libzypp library which provides the ZYpp package manager. ZYpp is a Linux software management engine and open source project originally sponsored by Novell and provides a powerful dependency resolver and a convenient package management API. In this article, we will show you how to use the zypper package management tool to search for, install and remove packages along with a few other uses. We will be using the SUSE Enterprise Linux version 12 for the examples demonstrated in this article.   Example 1: Search for a Specific Package To search for a package from a repository we use the zypper search command followed by the package name we want to search for. To demonstrate, let’s search for the package name git. linuxnix:~ # zypper search git Loading repository data... Reading...

Read More

APT-CACHE and APT-GET commands for package management in Ubuntu

Introduction In an earlier article, we demonstrated how you could use the dpkg package manager to install, remove and query information about software packages in the Ubuntu OS. In this article, we will show you how to use apt-cache to search for and query information about packages available in online and local repositories and we will also show you how to use apt-get to install and uninstall packages. Essentially apt-cache is the tool we use to query the apt software cache to obtain information about packages and apt-get is the tool we use for installing packages and modifying the state of packages installed on the system. All the examples demonstrated in this article were performed on an Ubuntu 16.04 system.   APT-CACHE examples   Example 1: List all available packages To list all packages available to be installed, we use the apt-cache pkgnames command as shown below root@linuxnix:~# apt-cache pkgnames libdatrie-doc libfstrcmp0-dbg librime-data-sampheng python-pyao-dbg fonts-georgewilliams python3-aptdaemon.test libcollada2gltfconvert-dev python3-doc8 r-bioc-hypergraph angrydd fonts-linuxlibertine ---------output truncated for brevity Note that this command only shows the package names and no other information about the package. Example 2: Search for a package To search for a package use the apt-cache search command followed by the package name. Let’s search for the nano text editor. root@linuxnix:~# apt-cache search nano nano - small, friendly text editor inspired by Pico alpine-pico - Simple text editor from Alpine,...

Read More

12 DPKG command examples

Introduction The package manager for Debian and distros derived from Debian is called dpkg or Debian package. As users, we can use dpkg directly or use higher level programs like apt(advanced package management tool) which gives us a few more features. Utilities such as dpkg-deb and dpkg-query use dpkg as a front-end to perform some actions. In this article, we will demonstrate how you can use the dpkg package manager to list, install, uninstall and query package on an Ubuntu 16.04 system. Example 1: Display dpkg version To display the version of the dpkg package manager installed on your system use the dpkg command with the –version option. root@linuxnix:~# dpkg --version Debian 'dpkg' package management program version 1.18.4 (amd64). This is free software; see the GNU General Public License version 2 or later for copying conditions. There is NO warranty. root@linuxnix:~#   Example 2: List all installed packages Using the dpkg command with the -l option lists all packages currently installed on the system. root@linuxnix:~# dpkg -l Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-==================================-======================================= ii accountsservice 0.6.40-2ubuntu11.1 amd64 query and manipulate user account information ii adduser 3.113+nmu3ubuntu4 all add and remove users and groups ii apparmor 2.10.95-0ubuntu2 amd64 user-space parser utility for AppArmor ii apt 1.2.12~ubuntu16.04.1 amd64 commandline package manager ii apt-transport-https 1.2.12~ubuntu16.04.1 amd64 https download transport for APT -----------------------------------------------------------output truncated for brevity...

Read More

Monitoring a Remote Centos 6 server with Nagios core

Introduction In our earlier articles on nagios we explained in detail how to install nagios core on the centos 6 system and configure it. In this article we will explain step by step how to monitor a remote machine with nagios core. Prerequisites: We will be installing the packages required for configuring nagios on a client machine using the EPEL repository therefore it must be enabled on the system. Please go through our article on how to enable the EPEL repository if you are unfamiliar about how to do so. Install NRPE and nagios plugins Now we will install the nrpe package along with nagios plugins using yum. [ssuri@nagios-client:~] $ sudo yum install nrpe nagios-plugins-all Loaded plugins: rhnplugin, security This system is receiving updates from RHN Classic or RHN Satellite. Setting up Install Process ------------------------------------output truncated for brevity Installed: nagios-plugins-all.x86_64 0:2.2.1-4git.el6 Dependency Installed: fping.x86_64 0:2.4b2-10.el6 lgtonmc.x86_64 0:9.2.1.2-1 lm_sensors.x86_64 0:3.1.1-17.el6 nagios-plugins.x86_64 0:2.2.1-4git.el6 nagios-plugins-breeze.x86_64 0:2.2.1-4git.el6 nagios-plugins-by_ssh.x86_64 0:2.2.1-4git.el6 nagios-plugins-cluster.x86_64 0:2.2.1-4git.el6 nagios-plugins-dhcp.x86_64 0:2.2.1-4git.el6 nagios-plugins-dig.x86_64 0:2.2.1-4git.el6 nagios-plugins-disk.x86_64 0:2.2.1-4git.el6 nagios-plugins-disk_smb.x86_64 0:2.2.1-4git.el6 nagios-plugins-dns.x86_64 0:2.2.1-4git.el6 nagios-plugins-dummy.x86_64 0:2.2.1-4git.el6 nagios-plugins-file_age.x86_64 0:2.2.1-4git.el6 nagios-plugins-flexlm.x86_64 0:2.2.1-4git.el6 nagios-plugins-fping.x86_64 0:2.2.1-4git.el6 nagios-plugins-game.x86_64 0:2.2.1-4git.el6 nagios-plugins-hpjd.x86_64 0:2.2.1-4git.el6 nagios-plugins-http.x86_64 0:2.2.1-4git.el6 nagios-plugins-icmp.x86_64 0:2.2.1-4git.el6 nagios-plugins-ide_smart.x86_64 0:2.2.1-4git.el6 nagios-plugins-ircd.x86_64 0:2.2.1-4git.el6 nagios-plugins-ldap.x86_64 0:2.2.1-4git.el6 nagios-plugins-load.x86_64 0:2.2.1-4git.el6 nagios-plugins-log.x86_64 0:2.2.1-4git.el6 nagios-plugins-mailq.x86_64 0:2.2.1-4git.el6 nagios-plugins-mrtg.x86_64 0:2.2.1-4git.el6 nagios-plugins-mrtgtraf.x86_64 0:2.2.1-4git.el6 nagios-plugins-mysql.x86_64 0:2.2.1-4git.el6 nagios-plugins-nagios.x86_64 0:2.2.1-4git.el6 nagios-plugins-nt.x86_64 0:2.2.1-4git.el6 nagios-plugins-ntp.x86_64 0:2.2.1-4git.el6 nagios-plugins-ntp-perl.x86_64 0:2.2.1-4git.el6 nagios-plugins-nwstat.x86_64 0:2.2.1-4git.el6 nagios-plugins-oracle.x86_64 0:2.2.1-4git.el6 nagios-plugins-overcr.x86_64 0:2.2.1-4git.el6 nagios-plugins-perl.x86_64 0:2.2.1-4git.el6 nagios-plugins-pgsql.x86_64 0:2.2.1-4git.el6 nagios-plugins-ping.x86_64 0:2.2.1-4git.el6 nagios-plugins-procs.x86_64 0:2.2.1-4git.el6 nagios-plugins-real.x86_64 0:2.2.1-4git.el6 nagios-plugins-rpc.x86_64 0:2.2.1-4git.el6 nagios-plugins-sensors.x86_64 0:2.2.1-4git.el6 nagios-plugins-smtp.x86_64...

Read More

Installing Nagios on Centos 7 part 3 (Nagios configuration)

Introduction In our previous two articles we’ve explained how to install Nagios core on a Centos 7 system and how to install Nagios plugin and the Nagios Remote Plugin Executor. In this article we will explain how to configure Nagios so that we can have the web interface up and running. Note that this needs to be done only once on the Nagios server. You may make amendments as deemed necessary. Update the Nagios main configuration file: The nagios.cfg file is the heart of your nagios core configuration. The location of this file may vary depending on where you installed nagios. The general location of the file is /usr/local/nagios/etc/nagios.cfg This file contains information about the location of other configuration files and template files which nagios will read in order to determine which assets are to be monitored and which services on those assets are to be monitored. We can define the location to these configuration files using the cfg_file directive. By default Nagios already has most of the configuration files set up and ready to use as shown below: [ssuri@linuxnix:/usr/local/nagios/etc] $ grep -E '^cfg_file' nagios.cfg cfg_file=/usr/local/nagios/etc/objects/commands.cfg cfg_file=/usr/local/nagios/etc/objects/contacts.cfg cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg cfg_file=/usr/local/nagios/etc/objects/templates.cfg cfg_file=/nagiosap/objects/hostgroups/linux.cfg cfg_file=/usr/local/nagios/etc/objects/localhost.cfg We will talk about the purpose of these configuration files in greater detail in later articles. You could also define a directory location and tell nagios to read all files ending with .cfg extension within that directory. Add...

Read More

Nagios installation on Centos 7 part 2 (installing plugins and NRPE)

Introduction In our previews article we walked you through installing nagios core on a Centos 7 system. In this article we will explain how to install Nagios plugins and the Nagios Remote Plugin Executor (NRPE) package. How does Nagios work? Nagios core runs from a central server which holds the configuration files. It runs active checks to monitor the state of services like HTTP and SSH, check if the server is up via ICMP and also monitor resource consumption like in the form of CPU load, memory utilization etc. The core server has a huge library of plugins and much of the functionality and flexibility of Nagios is derived from the use of these plugins. What are Nagios plugins? Plugins are compiled executable or scripts (Perl scripts, shell scripts, etc.) that can be run from a command line to check the status or a host or service.  Nagios uses the results from plugins to determine the current status of hosts and services on your network. Nagios will execute a plugin whenever there is a need to check the status of a service or host.  The plugin does something to perform the check and then simply returns the results to Nagios. It will process the results that it receives from the plugin and take any necessary actions. Installing Nagios plugins The plugins which provide the most commonly needed and used monitoring...

Read More

Over 16,000 readers, Get fresh content from “The Linux juggernaut”

Email Subscribe

ABOUT ME..!

My photo
My name is Surendra Kumar Anne. I hail from Vijayawada which is cultural capital of south Indian state of Andhra Pradesh. I am a Linux evangelist who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. At present I work at Bank of America as Sr. Analyst Systems and Administration. You can contact me at surendra (@) linuxnix dot com.