Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux:skoleni:nagios [2014/05/28 16:59]
admin
linux:skoleni:nagios [2016/12/05 15:00] (current)
admin
Line 1: Line 1:
 +====== Poznamky z kurzu skoleni nagios ======
 +
 +<code bash>
 iptables -I OUTPUT -d 10.0.4.159 -j REJECT iptables -I OUTPUT -d 10.0.4.159 -j REJECT
 iptables -I OUTPUT -d 10.0.4.159 -p tcp --dport 22 -j REJECT iptables -I OUTPUT -d 10.0.4.159 -p tcp --dport 22 -j REJECT
 +</​code>​
 +
 +===== Monitoring ucebny =====
 +A vytvoreni 2D mapy pomoci template
 +
 +{{ :​linux:​skoleni:​tmp_5876-img_20160129_104551-249151051.jpg?​600 |}}
 +
 +
 +<file nagios-ucebna.txt>​
 +nagios-ucebna.txt
 +tomas 42 9 226 240
 +noro 22 7 622 310
 +martin 29 5 711 319
 +jakub 23 10 584 114
 +marek 31 4 436 169
 +vladimir 40 38 75 95
 +</​file>​
 +
 +<file ucebna.templ>​
 +define host {
 +        use             ​generic-host
 +        host_name ​      ​_JMENO_
 +        alias           ​_JMENO_
 +        address ​        ​192.168.6._IP_
 +        parents ​        ​lektor_nb
 +
 +        2d_coords ​      ​_X_,​_Y_
 +        statusmap_image up.gd2
 +}
 +</​file>​
 +
 +<file ucebna-parent.templ>​
 +define host {
 +        use             ​generic-host
 +        host_name ​      ​_JMENO_
 +        alias           ​_JMENO_
 +        address ​        ​192.168.6._IP_
 +        parents ​        ​_PARENT_
 +
 +        2d_coords ​      ​_X_,​_Y_
 +        statusmap_image up.gd2
 +}
 +</​file>​
 +
 +
 +<code bash>
 +#!/bin/bash
  
 +cat nagios-ucebna.txt | while read jmeno ip1 ip2 x y; do
 +        sed "​s/​_JMENO_/​$jmeno$ip1/;​s/​_IP_/​$ip1/;​s/​_PARENT_/​$jmeno$ip2/;​s/​_X_/​$x/;​s/​_Y_/​$y/"​ ucebna-parent.templ
 +        let xx=$x+30
 +        sed "​s/​_JMENO_/​$jmeno$ip2/;​s/​_IP_/​$ip2/;​s/​_X_/​$xx/;​s/​_Y_/​$y/"​ ucebna.templ
 +done
 +</​code>​
  
 +apt-get install nagios-nrpe-server
  
 
linux/skoleni/nagios.1401289176.txt.gz · Last modified: 2014/05/28 16:59 by admin