Undefined variable: f2 - snmptrapsender.inc.php

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
chicjo01
Posts: 194
Joined: Tue Jul 28, 2015 2:52 pm

Undefined variable: f2 - snmptrapsender.inc.php

Post by chicjo01 »

FYI, I am seeing this error in my error_log. It appears to be a fat-finger from the DEV who worked on that area.

Version: Nagios XI 5.2.3

/var/log/httpd/error_log
[Tue Feb 23 15:15:41.133133 2016] [:error] [pid 98553] [client xxx.xxx.xxx.xxx:56257] PHP Notice: Undefined variable: f2 in /usr/local/nagiosxi/html/includes/components/snmptrapsender/snmptrapsender.inc.php on line 485

Code: Select all

    $f = "/usr/local/nagiosxi/html/includes/components/" . $snmptrapsender_component_name . "/installed.ok";
    $f = "/usr/local/nagiosxi/html/includes/components/" . $snmptrapsender_component_name . "/installed";

    // Install file doesn't exist
    if (!file_exists($f) || !file_exists($f2)) {
        return false;
    }
Corrected the issue by changing the 2nd $f to $f2

Code: Select all

    
    $f = "/usr/local/nagiosxi/html/includes/components/" . $snmptrapsender_component_name . "/installed.ok";
    $f2 = "/usr/local/nagiosxi/html/includes/components/" . $snmptrapsender_component_name . "/installed";

    // Install file doesn't exist
    if (!file_exists($f) || !file_exists($f2)) {
        return false;
    }
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Undefined variable: f2 - snmptrapsender.inc.php

Post by rkennedy »

Thanks for letting us know! I've passed this information onto the developers.
Former Nagios Employee
Locked