Project

General

Profile

Actions

Bug #8586

closed

Gateway Group trigger level

Added by Mauro Parente over 5 years ago. Updated over 5 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Gateways
Target version:
Start date:
06/20/2018
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
All
Affected Architecture:
All

Description

Hi to all,
i think there is a problem using trigger level in gateway group other than "member down".

In function "return_gateway_groups_array" in file "/etc/inc/gwlb.inc" there is a check over the gateway group trigger, but it cannot work, because in config the trigger is saved as integer (0, 1, 2, 3) while the check try to find word ("loss", "latency").

Someone can confirm that?

CONFIG

Array
(
    [0] => Array
        (
            [name] => GW_WAN_GROUP_01
            [item] => Array
                (
                    [0] => WAN_UMTSGW|1|_vip5a60be577ad2b
                    [1] => WAN_VSATGW|2|_vip5a4bc724a886d
                )

            [trigger] => 0
            [descr] =>
        )

    [1] => Array
        (
            [name] => WAN_GROUP_PROD
            [item] => Array
                (
                    [0] => WAN_VSATGW|2|_vip5a4bc724a886d
                )

            [trigger] => 1
            [descr] =>
        )

    [2] => Array
        (
            [name] => WAN_GROUP_EMER
            [item] => Array
                (
                    [0] => WAN_UMTSGW|1|address
                    [1] => WAN_VSATGW|2|address
                )

            [trigger] => 0
            [descr] =>
        )

)

CHECK

                                        if (stristr($status['status'], "down")) {
                                                $msg = sprintf(gettext('MONITOR: %1$s is down, omitting from routing group %2$s'), $gwname, $group['name']);
                                                $gwdown = true;
                                        } else if (stristr($status['status'], "loss") && strstr($group['trigger'], "loss")) {
                                                /* packet loss */
                                                $msg = sprintf(gettext('MONITOR: %1$s has packet loss, omitting from routing group %2$s'), $gwname, $group['name']);
                                                $gwdown = true;
                                        } else if (stristr($status['status'], "delay") && strstr($group['trigger'] , "latency")) {
                                                /* high latency */
                                                $msg = sprintf(gettext('MONITOR: %1$s has high latency, omitting from routing group %2$s'), $gwname, $group['name']);
                                                $gwdown = true;
                                        }

Actions

Also available in: Atom PDF