wiki:NSM2021/Agenda/icinga_handson_cont

Version 10 (modified by deepthi, 4 years ago) ( diff )

--

Icinga Hands - On - Cont

Through this hands-on you see

  • How to add a host
  • How to add a service
  • How to check DNS
  • How to add an agent
  • How to monitor disk space
  • How to check files

How to add a host

How to add a host template

Before adding hosts, the host templates have to be added. These templates should have the details on how host needs to be checked.

https://ws.learn.ac.lk/raw-attachment/wiki/NSM2021/Agenda/iCinga/host_template28.png

Add a host

Add the hosts after adding host template:

https://ws.learn.ac.lk/raw-attachment/wiki/NSM2021/Agenda/iCinga/add_hosts30.png

How to add a Service

How to add a service template

Before adding services, the service templates has to be added,

https://ws.learn.ac.lk/raw-attachment/wiki/NSM2021/Agenda/iCinga/service_template32.png

Add a Service

After, services can be added as following as per requirements:

https://ws.learn.ac.lk/raw-attachment/wiki/NSM2021/Agenda/iCinga/service33.png

Check DNS

Add the service template to dns check as follows,

https://ws.learn.ac.lk/raw-attachment/wiki/NSM2021/Agenda/icinga_handson_cont/dnscheck.png

Rest is same as before we applied the services to the hosts.

How to add an Agent

Host template for agents

Agent settings are not available for modification directly on a host object. This requires you to create an “Icinga Agent” template. You could name it exactly like that; it’s important to use meaningful names for your templates.

For setting up an agent, Host template should be created using iCinga director as follows,

Icinga director > Hosts > Host Templates

Main Properties will be shown as following

https://ws.learn.ac.lk/raw-attachment/wiki/NSM2021/Agenda/icinga_handson_cont/agent1_host_template.png

In the Icinga agent and zone settings , Following options should be selected,

https://ws.learn.ac.lk/raw-attachment/wiki/NSM2021/Agenda/icinga_handson_cont/agent_host_template2.png

NOTE : You should click deploy pending changes in Activity log section under Icinga Director

Adding hosts as agents

Note : Always try to use meaningful names in configurations

After creating host template for, host can be added as an agent for the system.

Icinga director > Hosts > Host

As following example, the details should be assigned as per the requirement,

https://ws.learn.ac.lk/raw-attachment/wiki/NSM2021/Agenda/icinga_handson_cont/adding_agent_host.png

After apply the deployment, setup preparation for agent has to be done

Before Executing the agent scripts…

Before executing the agent scripts in the relevant machines,

Icinga2 have to be installed in the Agent as following instructions below,

apt-get -y install apt-transport-https wget gnupg

wget -O - https://packages.icinga.com/icinga.key | apt-key add -

. /etc/os-release; if [ ! -z ${UBUNTU_CODENAME+x} ]; then DIST="${UBUNTU_CODENAME}"; else DIST="$(lsb_release -c| awk '{print $2}')"; fi;

echo "deb https://packages.icinga.com/ubuntu icinga-${DIST} main" > /etc/apt/sources.list.d/${DIST}-icinga.list

echo "deb-src https://packages.icinga.com/ubuntu icinga-${DIST} main" >> /etc/apt/sources.list.d/${DIST}-icinga.list

apt-get update

apt-get install icinga2 monitoring-plugins

Note : Please check the /etc/hosts file and verify that the agent is resolving for the FQDNvof master node before executing the agent scripts. (Otherwise you will not be able to connect agent hosts with a certificate error)

icinga director > hosts > host >, click on the agent and agent tab contains the scripts for agent manual configurations.

Click on the agent host you added and a tab called Agent will be shown as in the following image,

https://ws.learn.ac.lk/raw-attachment/wiki/NSM2021/Agenda/icinga_handson_cont/agent_scripts.png

You will see two scripts to execute on agent hosts.

They are for Agent deployment instructions, you will get Windows Kickstart Script and a command line script for the agents as above in the example.

Download them in the the agent hosts and execute the scripts for configurations.

./icinga-agent.sh

After, To check wether the agent is added, execute following command on master as follow in the exemple

icinga2 ca list --all

https://ws.learn.ac.lk/raw-attachment/wiki/NSM2021/Agenda/icinga_handson_cont/master_listing_agents.jpeg

How to check disk space

Before adding the service to check the disk space in a host, add the service template for the diskspace with necessary commands as following image

https://ws.learn.ac.lk/raw-attachment/wiki/NSM2021/Agenda/icinga_handson_cont/diskspace_service.png

And after, Please add the service to the host to monitor the diskspace as follows

https://ws.learn.ac.lk/raw-attachment/wiki/NSM2021/Agenda/icinga_handson_cont/diskcheck1.png

https://ws.learn.ac.lk/raw-attachment/wiki/NSM2021/Agenda/icinga_handson_cont/diskcheck2.png

How to check files

Attachments (16)

Note: See TracWiki for help on using the wiki.