Category Archives: Tutoriale Linux

Install Icinga 2 and Icinga web 2 on Ubuntu 17.10 server


Sponsored Link

Icinga 2 is an open source monitoring system which checks the availability of your network resources, notifies users of outages and generates performance data for reporting.Scalable and extensible, Icinga2 can monitor large, complex environments across multiple locations.

Icinga Web 2 is a powerful PHP framework for web applications that comes in a clean and reduced design. It’s fast, responsive, accessible and
easily extensible with modules.

Preparing your system

Before installing Icinga 2 you need to make sure you have installed Ubuntu 17.10 LAMP server.

Install Icinga 2 on ubuntu 17.10

From the terminal run the following command

sudo apt-get install icinga2 icinga2-ido-mysql

This will install the main Icinga software, along with a database driver that enables Icinga to put historical data and other information into a MySQL database.

You will be presented with the following questions

Enable Icinga 2’s ido-mysql feature? YES

Configure database for icinga2-ido-mysql with dbconfig-common? YES

You’ll then be prompted to set up an Icinga database password. Create a strong password and record it for later. We’ll need it when setting up
the web interface.

Now you need to enable icinga2 mysql feature using the following commands

sudo icinga2 feature enable ido-mysql

sudo icinga2 feature enable command

sudo systemctl restart icinga2

If you don’t do the above steps you will be presented with the following error

There is currently no icinga instance writing to the IDO. Make sure that a icinga instance is configured and able to write to the IDO

Check the status of icinga2 using the following command

sudo systemctl status icinga2

Installing the Icinga2 Web Interface

Run the following command to install Icinga2 Web Interface

sudo apt-get install icingaweb2

Now you need to edit the /etc/php/7.1/apache2/php.ini file to enter the timezone

sudo nano /etc/php/7.1/apache2/php.ini

Add the time zone

date.timezone = Europe/London

Save and exit the file and restart the apache2 server using the following command

sudo systemctl restart apache2

Setting up the Icinga2 Web Interface

We need to configure the Icinga2 Web Interface using the web-based process before starting this we need to create setup token using the following command

sudo icingacli setup token create

You need to start the web interface using the following link

http://serverip/icingaweb2/setup

Setting up the Token

Enter the token created previously and click next

Selecting the Icinga Web2 Modules

Enabling the Monitoring module and Click Next to continue

Verifying the PHP settings

Authenticating Method select as database

Enter the Database details

Creating Icinga2 Web administration logins

Choosing the Application configuration options

Review all the selected settings

Configuring Monitoring Module

Review monitoring module configuration options

Icinga2 Login Interface

Once you login you should see similar to the following screen

After completing the installation check the icinga2 documentation for hosts monitoring setup.

Sponsored Link




Related posts

Install Cacti on ubuntu 17.10 server


Sponsored Link

Cacti is a complete network graphing solution designed to harness the power of RRDTool’s data storage and graphing functionality. Cacti provides a fast poller, advanced graph templating, multiple data acquisition methods, and user management features out of the box. All of this is wrapped in an intuitive, easy to use interface that makes sense for LAN-sized installations up to complex networks with thousands of devices.

Features

Graphs

Unlimited number of graph items can be defined for each graph optionally utilizing CDEFs or data sources from within cacti.
Automatic grouping of GPRINT graph items to AREA, STACK, and LINE[1-3] to allow for quick re-sequencing of graph items.
Auto-Padding support to make sure graph legend text lines up.
Graph data can be manipulated using the CDEF math functions built into RRDTool. These CDEF functions can be defined in cacti and can be used globally on each graph.
Support for all of RRDTool’s graph item types including AREA, STACK, LINE[1-3], GPRINT, COMMENT, VRULE, and HRULE.

Data Sources

Data sources can be created that utilize RRDTool’s “create” and “update” functions. Each data source can be used to gather local or remote data and placed on a graph.
Supports RRD files with more than one data source and can use an RRD file stored anywhere on the local file system.
Round robin archive (RRA) settings can be customized giving the user the ability to gather data on non-standard timespans while store varying amounts of data.

Data Gathering

Contains a “data input” mechanism which allows users to define custom scripts that can be used to gather data. Each script can contain arguments that must be entered for each data source created using the script (such as an IP address).
Built in SNMP support that can use php-snmp, ucd-snmp, or net-snmp.
Ability to retrieve data using SNMP or a script with an index. An example of this would be populating a list with IP interfaces or mounted partitions on a server. Integration with graph templates can be defined to enable one click graph creation for hosts.
A PHP-based poller is provided to execute scripts, retrieve SNMP data, and update your RRD files.

Templates

Graph templates enable common graphs to be grouped together by templating. Every field for a normal graph can be templated or specified on a per-graph basis.
Data source templates enable common data source types to be grouped together by templating. Every field for a normal data source can be templated or specified on a per-data source basis.
Host templates are a group of graph and data source templates that allow you to define common host types. Upon the creation of a host, it will automatically take on the properties of its template.

Graph Display

The tree view allows users to create “graph hierarchies” and place graphs on the tree. This is an easy way to manage/organize a large number of graphs.
The list view lists the title of each graph in one large list which links the user to the actual graph.
The preview view displays all of the graphs in one large list format. This is similar to the default view for the 14all cgi script for RRDTool/MRTG.

User Management

User based management allows administrators to create users and assign different levels of permissions to the cacti interface.
Permissions can be specified per-graph for each user, making cacti suitable for co location situations.
Each user can keep their own graph settings for varying viewing preferences.

Preparing your system

Before installing cacti you need to make sure you have installed Ubuntu 17.10 LAMP server.

Install Cacti on ubuntu 17.10 server

Open the terminal and run the following command

sudo apt-get install snmp snmpd cacti rrdtool cacti-spine

The above command starts the cacti installation.

Now select the webserver you want to use (in my case it is apache2)

2

Cacti database configurations select yes

3

Enter database admin user password
4

Mysql application password for cacti

5

confirm the password
6

THis will complete the Cacti installation.

 Login in to cacti

Point your web browser towards http://YOURSERVERIP/cacti/  and  login in to Cacti with the default admin/admin, and change the password to something more sensible

 

10

After login in to Cacti you should see similar to the following screen

Sponsored Link




Related posts

How to fix DNS problems after upgrading Ubuntu 17.10 from ubuntu 17.04/16.10/16.04


Sponsored Link



One of my friend recently upgraded his ubuntu 17.04 to ubuntu 17.10 and after the upgrade my DNS stopped working.

Use one of the solutions to fix DNS issue on Ubuntu 17.10

Solution 1

Add the google DNS server in /etc/systemd/resolved.conf file

sudo nano /etc/systemd/resolved.conf

add the following line

DNS=8.8.8.8
FallbackDNS=8.8.4.4

Save and exit the file

Restart the systemd-resolved using the following command

sudo systemctl restart systemd-resolved

Solution 2

Edit the /etc/NetworkManager/NetworkManager.conf file

sudo nano /etc/NetworkManager/NetworkManager.conf

Change

dns=dnsmasq

to

dns=systemd-resolved

restart NetworkManager using the following command

sudo systemctl restart NetworkManager

Solution 3

Edit /etc/nsswitch.conf file

sudo nano /etc/nsswitch.conf

comment out the following line

hosts: files

Save and exit the file

Solution 4

add a line nameserver 8.8.8.8 in /etc/resolv.conf

Install unbound with sudo apt-get install unbound

disable the troublesome daemon with:

sudo systemctl disable systemd-resolved

sudo systemctl stop systemd-resolved

add dns=unbound in the [main] section of

/etc/NetworkManager/NetworkManager.conf

enable unbound with:

sudo systemctl enable unbound-resolvconf

sudo systemctl enable unbound

Reboot the ubuntu PC/server

If you can share which solution worked for you is very useful for other users and if you have any other new solution that would help more users.

Note:- Some of the solutions are from askubuntu

Sponsored Link



Related posts

Multimedia Apps for the Linux Console | Linux.com


When last we met, we learned that the Linux console supports multimedia. Yes, really! You can enjoy music, movies, photos, and even read PDF files without being in an X session with MPlayer, fbi, and fbgs. And, as a bonus, you can enjoy a Matrix-style screensaver for the console, CMatrix.

You will probably have make some tweaks to your system to make this work. The examples used here are for Ubuntu Linux 16.04.

MPlayer

You’re probably familiar with the amazing and versatile MPlayer, which supports almost every video and audio format, and runs on nearly everything, including Linux, Android, Windows, Mac, Kindle, OS/2, and AmigaOS. Using MPLayer in your console will probably require some tweaking, depending on your Linux distribution. To start, try playing a video:

$ mplayer 

If it works, then hurrah, and you can invest your time in learning useful MPlayer options, such as controlling the size of the video screen. However, some Linux distributions are managing the framebuffer differently than in the olden days, and you may have to adjust some settings to make it work. This is how to make it work on recent Ubuntu releases.

First, add yourself to the video group.

Second, verify that /etc/modprobe.d/blacklist-framebuffer.conf has this line: #blacklist vesafb. It should already be commented out, and if it isn’t then comment it. All the other module lines should be un-commented, which prevents them from loading. Side note: if you want to dig more deeply into managing your framebuffer, the module for your video card may give better performance.

Add these two modules to the end of /etc/initramfs-tools/modules, vesafb and fbcon, then rebuild the initramfs image:

$ sudo nano /etc/initramfs-tools/modules
    # List of modules that you want to include in your initramfs.
    # They will be loaded at boot time in the order below.
    fbcon
    vesafb
    
$ sudo update-initramfs -u

fbcon is the Linux framebuffer console. It runs on top of the framebuffer and adds graphical features. It requires a framebuffer device, which is supplied by the vesafb module.

Now you must edit your GRUB2 configuration. In /etc/default/grub you should see a line like this:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

It may have some other options, but it should be there. Add vga=789:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash vga=789"

Reboot and enter your console (Ctrl+Alt+F1), and try playing a video. This command selects the fbdev2 video device; I haven’t learned yet how to know which one to use, but I had to use it to play the video. The default screen size is 320×240, so I scaled it to 960:

$ mplayer -vo fbdev2 -vf scale -zoom -xy 960 AlienSong_mp4.mov

And behold Figure 1. It’s grainy because I have a low-fi copy of this video, not because MPlayer is making it grainy.

MPLayer plays CDs, DVDs, network streams, and has a giant batch of playback options, which I shall leave as your homework to explore.

fbi Image Viewer

fbi, the framebuffer image viewer, comes in the fbida package on most Linuxes. It has native support for the common image file formats, and uses convert (from Image Magick), if it is installed, for other formats. Its simplest use is to view a single image file:

$ fbi filename

Use the arrow keys to scroll a large image, + and – to zoom, and r and l to rotate 90 degress right and left. Press the Escape key to close the image. You can play a slideshow by giving fbi a list of files:

$ fbi --list file-list.txt

fbi supports autozoom. With -a fbi controls the zoom factor. --autoup and --autodown tell fbi to only zoom up or down. Control the blend time between images with --blend [time], in milliseconds. Press the k and j keys to jump behind and ahead in your file list.

fbi has commands for creating file lists from images you have viewed, and for exporting your commands to a file, and a host of other cool options. Check out man fbi for complete options.

CMatrix Console Screensaver

The Matrix screensaver is still my favorite (Figure 2), second only to the bouncing cow. CMatrix runs on the console. Simply type cmatrix to start it, and Ctrl+C stops it. Run cmatrix -s to launch it in screensaver mode, which exits on any keypress. -C changes the color. Your choices are green, red, blue, yellow, white, magenta, cyan, and black.

CMatrix supports asynchronous key presses, which means you can change options while it’s running.

-B is all bold text, and -B is partially bold.

fbgs PDF Viewer

It seems that the addiction to PDF documents is pandemic and incurable, though PDFs are better than they used to be, with live hyperlinks, copy-paste, and good text search. The fbgs console PDF viewer is part of the fbida package. Options include page size, resolution, page selections, and most fbi options, with the exceptions listed in man fbgs. The main option I use is page size; you get -l, xl, and xxl to choose from:

$ fbgs -xl annoyingpdf.pdf

Learn more about Linux through the free “Introduction to Linux” course from The Linux Foundation and edX.

Disable netplan on Ubuntu 17.10


Netpaln is default network configuration tool introduced in ubuntu 17.10 and if you want to disable this to go back to old ways of configuring network use the following procedure.

Netplan is a YAML network configuration abstraction for various backends (NetworkManager, networkd).

It is a utility for easily configuring networking on a system. It can be used by writing a YAML description of the required network interfaces with what they should be configured to do. From this description it will generate the required configuration for a chosen renderer tool.

Note:- This is not recommended and this is for advanced users only

Edit the /etc/default/grub file

sudo nano /etc/default/grub

Add the following line

GRUB_CMDLINE_LINUX=”netcfg/do_not_use_netplan=true”

Save and exit the file

Now update the grub using the following command

sudo update-grub

You need to install ifupdown package

sudo apt install ifupdown

Now you can add all the interface details in /etc/network/interfaces file and reboot the ubuntu PC/server.

Sponsored Link



Related posts