Am 23.04.2013 09:03, schrieb Georg Schönberger: > Hi, > > I am currently testing my GPU plugin to check NVIDIA GPUs. > Unfortunately ePN is reporting a compile error: > [1366696967.225634] [016.0] [pid=837] ** Handling check result for service > 'GPU' on host 'localhost'... > [1366696967.225640] [016.1] [pid=837] HOST: localhost, SERVICE: GPU, CHECK > TYPE: Active, OPTIONS: 0, SCHEDULED: Yes, RESCHEDULE: Yes, EXITED OK: No, > RETURN CODE: 3, OUTPUT: **ePN failed to compile > /usr/lib/nagios/plugins/check_gpu_sensor: "Number found where operator > expected at (eval 1) line 791, near "case 0"" at /usr/lib/icinga/p1.pl line > 248.\n > [1366696967.225741] [016.1] [pid=837] Service is in a non-OK state! > > As seen above the problem is due to the switch/case statement: > use Switch; > [...] > switch($i){ > case 0 {$PERF_THRESHOLDS{'GPUTemperature'}[0] = $warn_list[$i]}; > [...] > > I have rewritten the plugin to use use feature qw(switch); now. This feature > is supported from 5.10.1: > http://perldoc.perl.org/perlsyn.html#Switch-Statements > > Can you provide any more detailed informations why ePN is failing here? > Is there a better way to circumvent this error (like to rewrite it to if/else > statements) if I want to ensure that older systems can also run the plugin? > > Thanks for you help, Georg > That might not be the answer you're waiting for but I'd disable ePN in the plugin. In most environments it's causing more trouble that it's worth using it.
------------------------------------------------------------------------------ Try New Relic Now & We'll Send You this Cool Shirt New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, & servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr _______________________________________________ icinga-users mailing list icinga-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/icinga-users