Tuesday, May 21st 2013, 7:58pm UTC+2
You are not logged in.
Birthday: Feb 17th 1982 (31)
Gender: male
Location: Karlsruhe
Number of monitoring servers: 1
Nagios Version: 3.4.1
Distributed monitoring: Nein
Redundant monitoring: Nein
Number of hosts: ca. 300
Number of services: ca. 3000
OS: RedHat 5
Plugin Version: 1.4.4
|
|
Source code |
1 2 3 4 |
100;10 200;5 300;1 400;20 |
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#!/bin/bash COUNTER=0 MESSAGES="" while IFS=';' read client count; do COUNTER=$((COUNTER + count)) MESSAGES="$MESSAGES\n[$client] - Count is $count." done < test.csv SERVICE_OUTPUT="The overall count is $COUNTER." SERVICE_OUTPUT="$SERVICE_OUTPUT$MESSAGES\n" echo -en "$SERVICE_OUTPUT" |
|
|
Source code |
1 2 3 4 5 |
The overall count is 36. [100] - Count is 10. [200] - Count is 5. [300] - Count is 1. [400] - Count is 20. |
|
|
Source code |
1 |
The overall count is 0. |
This post has been edited 1 times, last edit by "freddy4711" (Jul 15th 2012, 8:49am)
Gender: male
Number of monitoring servers: 2
Nagios Version: 3.2.1
Icinga Version: Icinga 1.7.x
Distributed monitoring: Nein
Redundant monitoring: Nein
Number of hosts: >70
Number of services: >200
OS: SLES11
Plugin Version: 1.4.15
Other Addons: NRPE 2.6, NSCA 2.7, PNP 0.4.14 / 0.6.18
|
|
Source code |
1 2 |
export COUNTER=0 export MESSAGES="" |
Birthday: Feb 17th 1982 (31)
Gender: male
Location: Karlsruhe
Number of monitoring servers: 1
Nagios Version: 3.4.1
Distributed monitoring: Nein
Redundant monitoring: Nein
Number of hosts: ca. 300
Number of services: ca. 3000
OS: RedHat 5
Plugin Version: 1.4.4
Gender: male
Number of monitoring servers: 2
Nagios Version: 3.2.1
Icinga Version: Icinga 1.7.x
Distributed monitoring: Nein
Redundant monitoring: Nein
Number of hosts: >70
Number of services: >200
OS: SLES11
Plugin Version: 1.4.15
Other Addons: NRPE 2.6, NSCA 2.7, PNP 0.4.14 / 0.6.18
Birthday: May 30th 1983 (29)
Gender: male
Location: Nürnberg
Occupation: Consultant / Developer beim besten Arbeitgeber der Welt @netways
Number of monitoring servers: Icinga: 4x dev, 10++ prod, Icinga2: 2x dev
Nagios Version: s/nagios/icinga/
Icinga Version: 1.9.0 / GIT
Distributed monitoring: Ja
Redundant monitoring: Ja
Number of hosts: 1000+
Number of services: 15000+
OS: RHEL, Debian, SUSE
Plugin Version: 1.4.16
IDO-Version: 1.9.0 / GIT MySQL/Postgresql/Oracle
Other Addons: Icinga Web, PNP, check_multi, inGraph, EventDB, LConf
Birthday: Feb 17th 1982 (31)
Gender: male
Location: Karlsruhe
Number of monitoring servers: 1
Nagios Version: 3.4.1
Distributed monitoring: Nein
Redundant monitoring: Nein
Number of hosts: ca. 300
Number of services: ca. 3000
OS: RedHat 5
Plugin Version: 1.4.4
Wieso sollte die Schleife nicht ausgeführt werden?Bist du sicher, daß die Schleife ausgeführt wird, wenn du das Script per NRPE aufrufst?
|
|
Source code |
1 |
command[plugin]=/opt/scripts/plugin.sh |
|
|
Source code |
1 |
check_nrpe -H localhost -c plugin |
Ich teste nicht mit dem root user. Ich bin mit dem User nagios angemeldet. Die Dateien test.csv und plugin.sh haben als User und Gruppe nagios:nagios, welcher auch der NRPE User ist.
Quoted
vermutlich hat der root user mit dem du testest, volle leseberechtigung auf test.csv, waehrend nrpe als nagios user das nicht hat. ich wuerde im plugin auf jeden fall einen check einbauen, ob a. die datei da ist und b. ob diese lesbar ist. wenn nicht, solls an nrpe unknown retourgeben.
Gender: male
Number of monitoring servers: 2
Nagios Version: 3.2.1
Icinga Version: Icinga 1.7.x
Distributed monitoring: Nein
Redundant monitoring: Nein
Number of hosts: >70
Number of services: >200
OS: SLES11
Plugin Version: 1.4.15
Other Addons: NRPE 2.6, NSCA 2.7, PNP 0.4.14 / 0.6.18
Birthday: Feb 17th 1982 (31)
Gender: male
Location: Karlsruhe
Number of monitoring servers: 1
Nagios Version: 3.4.1
Distributed monitoring: Nein
Redundant monitoring: Nein
Number of hosts: ca. 300
Number of services: ca. 3000
OS: RedHat 5
Plugin Version: 1.4.4
Birthday: May 30th 1983 (29)
Gender: male
Location: Nürnberg
Occupation: Consultant / Developer beim besten Arbeitgeber der Welt @netways
Number of monitoring servers: Icinga: 4x dev, 10++ prod, Icinga2: 2x dev
Nagios Version: s/nagios/icinga/
Icinga Version: 1.9.0 / GIT
Distributed monitoring: Ja
Redundant monitoring: Ja
Number of hosts: 1000+
Number of services: 15000+
OS: RHEL, Debian, SUSE
Plugin Version: 1.4.16
IDO-Version: 1.9.0 / GIT MySQL/Postgresql/Oracle
Other Addons: Icinga Web, PNP, check_multi, inGraph, EventDB, LConf