wombat.ch

your Partner for Network Design and CMS

Software Information

Icinga2 | 
for the spez Plugin path --> Icinga2 | (spez)Plugins | define path
working on Icinga2 (version: r2.9.1-1)
Plugin on Github Github syswombat (Gude 8220)


Expert Power Control 8220-1 - v1.0.4
epc8220


  cd /usr/lib/nagios/pluginsCustom    
  wget https://raw.githubusercontent.com/syswombat/icinga2/master/gude/epc8220/check_epc8220.sh    
  #   chmod +x check_epc8220.sh    
       
 steps on Icinga2
       
  vi /etc/icinga2/zones.d/master/02_INFRA/check_poco-01c.conf    
 

object CheckCommand "check_epc8220" {

command = [ PluginCustomDir + "/check_epc8220.sh" ]

arguments = { 
"$ARG1$" = { 
value = "$epc8220_host$"          
skip_key = true
}


"$ARG2$" = {
value = "$epc8220_community$"  
skip_key = true
}


"$ARG3$" = {
value = "$epc8220_check$"         
skip_key = true
}

"$ARG4$" = {
value = "$epc8220_warning$"      
skip_key = true
}

"$ARG5$" = {
value = "$epc8220_critical$"         
skip_key = true
}

}

vars.epc8220_host = "$host.address$"
vars.epc8220_community = "public"
vars.epc8220_check = "$epc8220-check$"
vars.epc8220_warning ="$epc8220-warning$"
vars.epc8220_critical = "$epc8220-critical$"
}

   
       
   vi /etc/icinga2/zones.d/master/02_INFRA/check_poco-01s.conf    
   object Service "check_epc8220-uptime" {
                   host_name = "poco-01.kozo.ch"

                         vars.epc8220-check ="systemuptime"
                         vars.epc8220-warning="0"
                         vars.epc8220-critical="0"


                   display_name = "System-Uptime: "
                   check_interval = 3600
                   check_command = "check_epc8220"
}
   
       
       
       
  #  icinga2 daemon -C    
  #  time systemctl reload icinga2    
  #  time systemctl restart icinga2    
  #   multitail /var/log/icinga2/icinga2.log    
c      
       
       
  cd  /usr/lib/nagios/plugins    
  ./check_snmp -H 10.147.42.31 -P 2c  -C public -o 1.3.6.1.2.1.1.3.0    
  SNMP OK - Timeticks: (645896904) 74 days, 18:09:29.04 |    
       
  ./check_snmp -H 10.147.42.31 -P 2c  -C public -o 1.3.6.1.2.1.1.3.0 | cut -d':'  -f2,3,4 -d'(' -d')'    
  74 days, 18:12:43.04 |    
-
-
-
-
-
   # snmpwalk -v 2c -c public 10.147.42.31
iso.3.6.1.2.1.1.1.0 = STRING: "Expert Power Control 8220-1"
iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.28507.38
iso.3.6.1.2.1.1.3.0 = Timeticks: (642915304) 74 days, 9:52:33.04
iso.3.6.1.2.1.1.4.0 = STRING: "sysContact"
iso.3.6.1.2.1.1.5.0 = STRING: "sysName"
iso.3.6.1.2.1.1.6.0 = STRING: "sysLocation"
iso.3.6.1.2.1.1.7.0 = INTEGER: 72
iso.3.6.1.2.1.2.1.0 = INTEGER: 1
iso.3.6.1.2.1.2.2.1.1.1 = INTEGER: 1
iso.3.6.1.2.1.2.2.1.2.1 = STRING: "eth_cf52259"
iso.3.6.1.2.1.2.2.1.3.1 = INTEGER: 6
iso.3.6.1.2.1.2.2.1.4.1 = INTEGER: 1500
iso.3.6.1.2.1.2.2.1.5.1 = Gauge32: 100000000
iso.3.6.1.2.1.2.2.1.6.1 = Hex-STRING: 00 19 32 00 A9 06
iso.3.6.1.2.1.2.2.1.7.1 = INTEGER: 1
iso.3.6.1.2.1.2.2.1.8.1 = INTEGER: 1
iso.3.6.1.2.1.2.2.1.9.1 = Timeticks: (642915304) 74 days, 9:52:33.04
iso.3.6.1.2.1.2.2.1.10.1 = Counter32: 3147205240
iso.3.6.1.2.1.2.2.1.11.1 = Counter32: 434786
iso.3.6.1.2.1.2.2.1.12.1 = Counter32: 19293392
iso.3.6.1.2.1.2.2.1.13.1 = Counter32: 0
iso.3.6.1.2.1.2.2.1.14.1 = Counter32: 25
iso.3.6.1.2.1.2.2.1.15.1 = Counter32: 0
iso.3.6.1.2.1.2.2.1.16.1 = Counter32: 272948366
iso.3.6.1.2.1.2.2.1.17.1 = Counter32: 469391
iso.3.6.1.2.1.2.2.1.18.1 = Counter32: 2779526
iso.3.6.1.2.1.2.2.1.19.1 = Counter32: 0
iso.3.6.1.2.1.2.2.1.20.1 = Counter32: 469394
iso.3.6.1.2.1.2.2.1.21.1 = Gauge32: 0
iso.3.6.1.2.1.2.2.1.22.1 = OID: ccitt.0
  #   snmpwalk -v 2c -c public 10.147.42.31 iso.3.6.1.4.1.28507.38

-
-
- - - -
Quellen/Source:
-  
-
-
-
-
-
-
- Add a comment
Icinga2 | 
for the spez Plugin path --> Icinga2 | (spez)Plugins | define path
working on Icinga2 (version: r2.9.1-1)




 steps on Icinga2
 1 #   cd /usr/lib/nagios/pluginsCustom
#   wget  
#  chmod +x 

 b
       
       
       
       
  #  icinga2 daemon -C    
  #  time systemctl reload icinga2    
  #  time systemctl restart icinga2    
  #   multitail /var/log/icinga2/icinga2.log    
c      
-
-
- - - -
Quellen/Source:
-  
-
-
-
-
-
dokuwiki.tachtler.net
- Add a comment
Icinga2 | check for certification validation
for the spez Plugin path --> Icinga2 | (spez)Plugins | define path
working on Icinga2 "#    icinga2 daemon -C  "   (version: r2.9.1-1) 




 steps on Icinga2
 1 #   cd /usr/lib/nagios/pluginsCustom
#   wget  https://raw.githubusercontent.com/matteocorti/check_ssl_cert/master/check_ssl_cert
#  chmod +x check_ssl_cert
#   ./check_ssl_cert -H kozo.ch -w 30 -c 15

SSL_CERT OK - x509 certificate 'kozo.ch' from 'Let's Encrypt Authority X3' valid until Sep 14 22:41:31 2018 GMT (expires in 32 days)|days=32;30;15;;
 b
c vi /etc/icinga2/conf.d/07_urls/0_check_x509.conf    
  object CheckCommand "check_x509" {
   command = [ PluginCustomDir + "/check_ssl_cert" ]
   arguments = {
   "-H" = "$http_url$"
   "-w" = "30"
   "-c" = "15"
   }
}
   
  vi /etc/icinga2/conf.d/07_urls/0_tpl-x509.conf    
  template Service "x509" {
    host_name = "icinga2-01.kozo.ch"

    max_check_attempts = 3
    check_interval = 3m
    retry_interval = 30s
 }
   
  vi /etc/icinga2/conf.d/07_urls/x509_xxxxxxxxx.conf
cd /etc/icinga2/conf.d/07_urls/ 
 
  object Service "check_url-alvearium-info" {
      import "x509"
            vars.http_url = "alvearium.info"
      display_name = "X.509-Zertifikate --> " + vars.http_url

     check_command = "check_x509"
}
   
 

 

   
       
       
  #    icinga2 daemon -C
#    time systemctl reload icinga2
#    time systemctl restart icinga2
#     multitail /var/log/icinga2/icinga2.log
   
       
   <Timeout exceeded.><Terminated by signal 9 (Killed).> after update to (version: r2.10.1-1) 520     TIMEOUT="15" change to 30
       
-
-
- - - -
Quellen/Source:
-  Github | matteocorti/check_ssl_cert
-
-
-
-
-
-
- Add a comment

-
-

 1 #   mkdir -p /etc/sysconfig
#   ln -s /usr/lib/icinga2/icinga2 /etc/sysconfig/icinga2
#   apt -y install ruby bundler nodejs npm
 gem install bundler
gem install dashing
#   cd /usr/share
#   git clone https://github.com/dnsmichi/dashing-icinga2.git
#   cd dashing-icinga2
 bundle install --system
 icinga2 feature enable api
#    vi /etc/icinga2/conf.d/api-users.conf [...]
object ApiUser "dashing" {
  password = "f6acCfj4k8aC"
  permissions = [ "status/query", "objects/query/*" ]
}
[...]
#   systemctl restart icinga2
#  vi /usr/share/dashing-icinga2/config/icinga2.json [...]
{
  "icinga2": {
    "api": {
      "host": "10.147.42.36",
      "port": 5665,
      "user": "dashing",
      "password": "PASSWORD"
    }
  },
  "icingaweb2": {
    "url": "http://10.147.42.36/icingaweb2"
  }
}
 [...]











Quellen/Source:
https://monitoring-portal.org/t/icinga-installation-guide-1o1/3430
- Github | dnsmichi/dashing-icinga2
-
-
-
-
-

Add a comment

Icinga2 | dependencies

Imagine, you have a Switch with 3 NAS on it - the NAS are not often used and Switched off like the Switch itself.
so
the Host-Check to the NAS should only be when Switch is on and hostalive!
the NAS-Service-Check should only be if the NAS ist up = hostalive!

#  cd /etc/icinga2/conf.d
#  mkdir dependence
#   cd dependence
#   vi switch2nas.conf
object Dependency "switch2nas" {
    parent_host_name = "swt-03.kozo.ch"

    child_host_name = "NAS-01.kozo.ch"
    child_host_name = "NAS-02.kozo.ch"
    child_host_name = "NAS-03.kozo.ch"

     states = [ Up ]

     disable_checks = true
       disable_notifications = true

 }
   Go to the Host you wish to add the dependency

This will by a Host - Host dependency
if the Switch swt-03 is down 
the NAS-01 get unrechable marked

object Dependency "nas-01-swt-03" {
     parent_host_name = "swt-03.kozo.ch"
     child_host_name = "NAS-01.kozo.ch"
      states = [ Up ]
      disable_checks = true
      ignore_soft_states = true
     disable_notifications = true
 }

 
       
       
       
       
       
       
       
  #   icinga2 daemon -C    
  #   systemctl reload icinga2    
  #   systemctl status icinga2    
  #   multitail /var/log/icinga2/icinga2.log    

-
-

Quellle/Source:
-

-
-
Icinga2 Doc | Dependency
Icinga2 Doc | Dependencies
Icinga2 Doc | Apply Dependencies to Hosts and Services
-
-
-
-
-
-
-
- -


modul-icinga-articlelist

Add a comment
Icinga2 |add Raspberry Pi (Debian9)


     
   object CheckCommand "by_ssh_apt" {  
        import "by_ssh"

        vars.by_ssh_command = "/usr/lib/nagios/plugins/check_apt -w $by_ssh_apt_warn$ -c $by_ssh_apt_crit$"  
                vars.by_ssh_apt_warn = "75%"  
                vars.by_ssh_apt_crit = "50%"
}

apply Service "by_ssh_apt" {  
          import "generic-service"

          host_name = "10.147.42.32"  
          check_command = "by_ssh_apt"

          vars.by_ssh_logname = "pi"

}
 
     












QUellen/Source:
docs/icinga2/latest/doc/07-agent-based-monitoring/#ssh
remote-sensor-raspberry-pi-locale-temperature-monitoring-snmp-and-cacti
-
-
-
-
-
-
-
-
- monitoring-portal.org
_

modul-icinga-articlelist

Add a comment






the place of the Plugin itself #   cd /usr/lib/nagios/pluginsCustom  
the plugin - make a servie #   cd /etc/icinga2/conf.d  
the service - add to host or hostgroup #   cd /etc/icinga2/zones.d/  

Add a comment
-
-
-
create a email Address for this Purpose This email address is being protected from spambots. You need JavaScript enabled to view it.
check if a MTA
(Mail Transfer Agent)
is working
echo "Test hier kann viel stehen" | mail -s "Test mail subject 15"   This email address is being protected from spambots. You need JavaScript enabled to view it.
#   vi /etc/icinga2/conf.d/users.conf add your email address around line 12 on a Default installation
       
       
       
       
       
       
       
 vars.notification["mail"] = {
    groups = [ "icingaadmins" ]
}













Quellen/Source:
-
- https://blog.mattionline.de/icinga2-push-notification-via-telegram/
- https://github.com/sysadmama/icinga2-notification-telegram
- https://github.com/lazyfrosch/icinga2-telegram
-
- (2016) NETWAYS Video: Icinga 2: Einrichten von Notifications (Webinar vom 21. Januar 2016)
-
-
-
-

modul-icinga-articlelist

Add a comment

I will describe how i did install the check_nwc_health plugin

to use spez Plugin i have a spez directory (--> Icinga2 | (spez)Plugins | define path)


 Step on the Icinga2 Master 
#  cd /usr/lib/nagios/pluginsCustom
# mkdir  check_nwc_health
#  cd /usr/lib/nagios/pluginsCustom/check_nwc_health
#  cd /tmp
#  wget https://labs.consol.de/assets/downloads/nagios/check_nwc_health-7.1.tar.gz
  #  tar -xvzf   check_nwc_health-7.1.tar.gz    
  #  cd /check_nwc_health-7.1    
  ./configure    
  make    
  mv plugins-scripts  /usr/lib/nagios/pluginsCustom/check_nwc_health    










-
check_nwc_health
Lausser and check_nwc_health on github.com
how to install it...
-

Add a comment

add a service to a hostgroup

i have a couple of Debian 9 "Server/Host/Client" they all should have some Basic Service Check like (apt, disk, mem, swap, procs, users, running_kernel, apt, ssh, iostat, ping4, fping4, tcp, udp, ssl, ntp_time)

because i don't want to add this check to each host  i did define a hostgroup and add the hostgroupname to the host (--> "define Hostgroup & add Host to a Hostgroup")

 Merci to rsx (Roland) 

 steps i have done... icinga2 Master
 went to the zone.d #  cd /etc/icinga2/zones.d/
 crate a new directory #  mkdir services
 went to the new directory #  cd /services
or #  cd /etc/icinga2/zones.d/services
open a new file # vi service2debian9.conf      
to check apt on all defined Debian 9 "Host/Server/Client" apply Service "apt" {
  import "generic-service"
  check_command = "apt"

  assign where host.address && host.vars.os == "debian9"
  command_endpoint = host_name
 }
     
to Check swap apply Service "swap" {
  import "generic-service"
  check_command = "swap"

  assign where host.address && host.vars.os == "debian9"
  command_endpoint = host_name
 }
     
 Check it if it for error #  icinga2 daemon -C      
if ok #  systemctl restart icinga2      





---

 Sometimes all would be perfect but a Service is on a Host not needed or not available.
so you will get a error.
to avoid the error - just ignore the host like this

32 apply Service "swap" {
33 import "generic-service"
34 check_command = "swap"
35
36 assign where host.address && host.vars.os == "debian9"
37 ignore where host.name == "memoryalpha.kozo.ch"
38 command_endpoint = host_name
39 }
     
  #  icinga2 daemon -C      
  #  systemctl restart icinga2      

---
Quellen/Source:
- 05-service-monitoring/#general-monitoring
have a look and for my test
-
-
-
-
- Add a comment
Define a Hostgroup Debian
for all your Debian 9 client and Server
 #  vi /etc/icinga2/conf.d/groups.conf   object HostGroup "debian9" {
display_name = "Debian 9"

assign where host.vars.os == "debian9"
}
 
         
add definition to a Host #  cd /etc/icinga2/zones.d/master/ open your hostfile endig with *.conf object Host "client.kozo.ch" {

check_command = "hostalive" //check is executed on the master
display_name = "client name text"
address = "10.147.42.63"
vars.os = "debian9"

vars.client_endpoint = "name" //follows the convention that host name == endpoint name
}
 
         
do a check if it is OK #  icinga2 daemon -C      
and if OK - restart #   systemctl reload icinga2      
-

NOW --> add service to a hostgroup
-

modul-icinga-articlelist

- Add a comment

#  cd /etc/icinga2/conf.d conf.d Directory (hosts.conf, services.conf, users.conf, notifications.conf, commands.conf, groups.conf, templates.conf, downtimes.conf, timeperiods.conf, api-users.conf, app.conf )
Service icinga.com/docs/icinga2/latest/doc/09-object-types/#service
       
       
Warning/Critical how to define +/- Nagios Guideline (search for " Threshold and Ranges " )  
       
       
       
       
Add a comment

Icinga2 | Upgrade Information for Debian 9
Icinga2 Update/Upgrade information

Step todo comand text -
For a Client check the Version you have #  icinga2 --version
0
#  wget -O - https://packages.icinga.com/icinga.key | apt-key add -
#  vi /etc/apt/sources.list deb http://packages.icinga.com/debian icinga-stretch main
deb-src http://packages.icinga.com/debian icinga-stretch main
#  apt update -y
         
         
For the Master   #  icinga2 --version   (version: r2.6.0-1) i do have
  First update to 2.7 #  vi /etc/default/icinga2 ICINGA2_CACHE_DIR=/var/cache/icinga2  
    #  systemctl restart icinga2    
  then to 2.8 # ls /usr/share/icinga2-ido-mysql/schema/upgrade/   ls should Show some *.SQL file
    # mysql -u root -p icinga < /usr/share/icinga2-ido-mysql/schema/upgrade/2.8.0.sql   and also if you have newer files too





- - - -

modul-icinga-articlelist

 

- - - -


Quellen/Source:
- Upgrading Icinga 2
- [dev.icinga.com #13255] Deprecate cluster/client mode "bottom up" w/ repository.d and node update-config
-
-
-
-
-

Add a comment

RSS Feed


Warning: file_get_contents(https://www.bsi.bund.de/SiteGlobals/Functions/RSSFeed/RSSNewsfeed/RSSNewsfeed_WID.xml): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /var/www/clients/client2/web2/web/j/modules/mod_jw_srfr/helper.php on line 273

Warning: file_get_contents(https://www.bsi.bund.de/SiteGlobals/Functions/RSSFeed/RSSNewsfessBSIFB/RSSNewsfeed_BuergerCERT.xml): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /var/www/clients/client2/web2/web/j/modules/mod_jw_srfr/helper.php on line 273

Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/clients/client2/web2/web/j/modules/mod_jw_srfr/helper.php on line 273

Warning: file_get_contents(http://feeds.joomla.org/JoomlaAnnouncements): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/clients/client2/web2/web/j/modules/mod_jw_srfr/helper.php on line 273

Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/clients/client2/web2/web/j/modules/mod_jw_srfr/helper.php on line 273

Warning: file_get_contents(http://feeds.joomla.org/JoomlaSecurityNews): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/clients/client2/web2/web/j/modules/mod_jw_srfr/helper.php on line 273

Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:0A000152:SSL routines::unsafe legacy renegotiation disabled in /var/www/clients/client2/web2/web/j/modules/mod_jw_srfr/helper.php on line 273

Warning: file_get_contents(): Failed to enable crypto in /var/www/clients/client2/web2/web/j/modules/mod_jw_srfr/helper.php on line 273

Warning: file_get_contents(https://tools.cisco.com/security/center/psirtrss20/CiscoSecurityAdvisory.xml): failed to open stream: operation failed in /var/www/clients/client2/web2/web/j/modules/mod_jw_srfr/helper.php on line 273

Warning: Invalid argument supplied for foreach() in /var/www/clients/client2/web2/web/j/modules/mod_jw_srfr/helper.php on line 39

neusten Links


Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/clients/client2/web2/web/j/modules/mod_quicklistweblinks/helper.php on line 78
many More Links »

part of ...

Linux Counter

Disqus

 

Learning Network

Seti@home & Boinc

myBonic

statistik

 


Who is Online

We have 472 guests and no members online

We have 491 guests, no bots and no members online