regilero / check_phpfpm_status

Nagios check for php-fpm status report
GNU General Public License v3.0
39 stars 19 forks source link

Perl Notices on uninitialized values #4

Open doertedev opened 10 years ago

doertedev commented 10 years ago

I run: ./check_phpfpm_status.pl -H 127.0.0.1 -u /fpm_status -s SOMEFANCYURL -w 10,1,1 -c 5,2,2

And get: Use of uninitialized value $LastMaxListenQueue in numeric ge (>=) at ./check_phpfpm_status.pl line 416. Use of uninitialized value $LastMaxListenQueue in subtraction (-) at ./check_phpfpm_status.pl line 424. $Le actual Result$

regilero commented 10 years ago

Ok, let's assume SOMEFANCYURL is a domain name (DNS) and not an url. LastMaxListenQueue is always initialized (https://github.com/regilero/check_phpfpm_status/blob/master/check_phpfpm_status.pl#L387), so something may have set a null inside, maybe the read of the temporary file (https://github.com/regilero/check_phpfpm_status/blob/master/check_phpfpm_status.pl#L388-394).

Try to remove the tempfile or to read the content, it should be something like: /tmp/127.0.0.1_check_phpfpm_status<xxxxmd5_of_urlxxx> and the 4th line should be the content set in this variable.