Tech C**P
15 subscribers
161 photos
9 videos
59 files
304 links
مدرس و برنامه نویس پایتون و لینوکس @alirezastack
Download Telegram
If you want to monitor a specific tcp port on Icinga2 you just need to add another tcp variable:
object Host "host-web" {
import "generic-host-tpl"

address = "YOUR_SERVER_IP_ADDRESS"
vars.os = "Linux"

vars.tcp["OPTIONAL_NAME"]={
tcp_port=8181
}

Here in above sample we are monitoring port 8181 of host-web which has the IP address of YOUR_SERVER_IP_ADDRESS (change it to your server ip address remote or local).

#linux #monitoring #sysadmin #icinga2 #host #tcp #port
In icinga2 monitoring tools, you may have used check disk space command check_snmp_storage. In its default behaviour it lists all
the partitions which is present on disk either mounted by NFS or /run, etc.

In Incinga2 you would have a command called snmp-storage in /etc/icinga2/conf.d/commands. To exclude unnecessary partitions from all disks you can pass -e (e stands for exclude) argument to the perl command. You can use -m to pass regex to say which partitions you want to use.

e, --exclude:
Select all storages except the one(s) selected by -m
No action on storage type selection.

The final config for snmp-storage to exclude a list is like below:
object CheckCommand "snmp-storage" {
import "snmp-manubulon-command"

command = [ ManubulonPluginDir + "/check_snmp_storage.pl" ]

arguments += {
"-m" = "$snmp_storage_name$"
"-f" = {
set_if = "$snmp_perf$"
}
"-w" = 80
"-c" = 90
"-H" = "$address$"
"-m" = "^Cached|^Shared|^Swap|^/run|^Physical|^Memory|^Virtual|^/dev|^/sys"
"-e" = ""
}

vars.snmp_perf = true
}

In brief the combination of -m & -e means: select all partitions except the ones listed in front of -m.

#icinga2 #monitoring #snmp #snmp_storage #exlude #exclude_partition
A comprehensive management system for Apache Kafka®

https://www.confluent.io/product/control-center/

#kafka #confluent #monitoring
How to ignore a specific partition in Icinga2 monitoring server?

Sometimes a specific partition has been mounted on many servers. Now if you monitor disk partitions on Icinga2 and a warning message appears on that specific partition you will get notifications as many as your servers.

Icinga2 uses Snmp Storage Check in order to get disk partitions and their data. The command is located in /etc/icinga2/conf.d/ commands/snmp-storage.conf. (Its name maybe different in your case)

This command will use check_snmp_storage.pl nagios plugin, the overall structure of it is similar to:

object CheckCommand "snmp-storage" {
import "snmp-manubulon-command"

command = [ ManubulonPluginDir + "/check_snmp_storage.pl" ]

arguments += {
"-m" = "$snmp_storage_name$"
"-f" = {
set_if = "$snmp_perf$"
}
"-w" = 87
"-c" = 95
"-H" = "$address$"
"-m" = "^Cached|^Shared|^Swap|^/run|^Physical|^Memory|^Virtual|^/dev|^/sys|^/mnt/remote_folder"
"-e" = ""
}

vars.snmp_perf = true
}

-m parameter will ignore partitions. Here we have provided many partitions like /sys or /mnt/remote_folder. These partitions will be ignored all over. Add your desired partitions to this section.

To read more about this Perl plug-in head over to the below link:
- http://nagios.manubulon.com/snmp_storage.html

#monitoring #icinga2 #snmp #storage #snmp_storage
How do you upgrade Icinga2 from a very old version?

The short answer is that you need to do an incremental upgrade on its database.

But how exactly?

apt-get update
apt-cache policy icinga2-ido-mysql
The candidate section displays what version is available for you system. Do the same for icingaweb2:

apt-cache policy icingaweb2
Upgrade these packages alltogether:

apt-get upgrade -o Dpkg::Options::="--force-confold" -y
Update icinga2 packages:

apt-get upgrade icinga2 icinga2-bin icinga2-common icinga2-ido-mysql libicinga2
apt-get install icinga2-bin
apt-get install icinga2
Now check icinga2 log in tail -f /var/log/icinga2/icinga2.log, you may see errors like:

[2017-12-21 12:00:22 -0600] critical/IdoPgsqlConnection: Schema version '1.14.2' does not match the required version '1.14.3' (or newer)! Please check the upgrade documentation at https://docs.icinga.com/icinga2
Here you need to upgrade MySQL schemas, go to /usr/share/icinga2-ido-mysql/schema/upgrade path and now import new schemas to Icinga2 MySQL database. As I was in version 2.6.0 I went for 2.8.0:

mysql -u icinga2 -p icinga2 < 2.8.0.sql
It will prompt for password of user icinga2, enter the password and go on.

The content of MySQL Schemas is as follows:


2.0.2.sql  2.1.0.sql  2.2.0.sql  2.3.0.sql  2.4.0.sql  2.5.0.sql  2.6.0.sql  2.8.0.sql  2.8.1.sql
NOTE: to get the password for user icinga2 open /etc/icinga2/features-enabled/ido-mysql.conf file and get the password from here.


#linux #icinga2 #monitoring #icinga2 #icingaweb #upgrade
Tech C**P
How do you upgrade Icinga2 from a very old version? The short answer is that you need to do an incremental upgrade on its database. But how exactly? apt-get update apt-cache policy icinga2-ido-mysql The candidate section displays what version is available…
In case your upgrade failed, try to start icinga service and in the meantime check the logs in another console:

service icinga2 start

Check logs to see what is the error:

tail -f /var/log/icinga2/icinga2.log

If it point to a specific config file, change the config as reported or in case you don't need it remove it. It happened for me on another Icinga2 server and I removed the old config and tried to apply the new schemas. It gave another error on mysql grants, I gave all permissions to the icinga2 user:

mysql -u root -p
GRANT ALL PRIVILEGES ON icinga2_database_name.* TO 'icinga2_username'@'localhost'
flush privileges;

Now all things should be up and working now.

#icinga2 #monitoring #upgrade #schema_update #icinga