On 10.07.17 15:00, Christian Moreno Moreno wrote:
Hello,

We try to configure one new check with check_by_ssh:

apply Service "check_access_log" {
         import "standard-service"
         check_command = "check_by_ssh"


vars.ssh_command = '/usr/lib/nagios/plugins/check_file_age /var/log/axy/access.$(date +%Y-%m-%d).log -w 68400 -c 68400'
         assign where "frontend-ipc" in host.groups
}

But we got one Syntax Error for the $:

Correct. The $ sign starts a macro. See

https://docs.icinga.com/icinga2/latest/doc/module/icinga2/chapter/monitoring-basics#runtime-macros

/etc/init.d/icinga2 checkconfig
[....] checking Icinga2 configuration
information/cli: Icinga application loader (version: r2.6.3-1)
information/cli: Loading configuration file(s).
critical/config: Error: syntax error, unexpected $undefined
Location: in /etc/icinga2/zones.d/global-templates/services/check_logfiles.conf: 62:28-62:28
/etc/icinga2/zones.d/global-templates/services/check_logfiles.conf(61):
/etc/icinga2/zones.d/global-templates/services/check_logfiles.conf(62):          vars.ssh_command = '/usr/lib/nagios/plugins/check_file_age /var/log/price-comparison/access.$(date +%Y-%m-%d).log -w 68400 -c 68400' /etc/icinga2/zones.d/global-templates/services/check_logfiles.conf(63):          assign where "frontend-ipc" in host.groups

[FAIL] checking Icinga2 configuration. Check '/var/log/icinga2/startup.log' for details. ... failed!

We tryed with \$ but it doesnt run... has someone one idea?

What makes you think that it doesn't _run_?

It should run, even though it won't do what you expect as you don't call a shell which could expand the $() but check_file_age...

-Gerald



Regards,
Christian


Christian Moreno Moreno
System Engineer Offers

idealo internet GmbH
Ritterstraße 11
10969 Berlin, Deutschland
Tel.: +49 (0)30 40 30 10 33
Fax: +49 (0)30 221 94 33 <tel:%2B49%20%280%2930%20221%2094%2033> - 21
E-Mail: christian.mor...@idealo.de <mailto:christian.mor...@idealo.de>
Geschäftsführer:
Dr. Albrecht von Sonntag, Dr. Philipp-Christopher Peitsch
HRB 76749 – Amtsgericht Berlin-Charlottenburg
idealo Logo <http://www.idealo.de/>

















_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users

_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to