Ad Widget

Collapse

SMS messages not triggered on alerts

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dubfunkle
    Junior Member
    • May 2024
    • 11

    #1

    SMS messages not triggered on alerts

    Hi,

    I have configured the following SMS integration (https://www.labsmobile.com/en/sms-ap...modules/zabbix) but it is only working when I manually trigger this from ssh so when I do so I am able to receive an SMS. Now If I configure a trigger action to send an SMS on alert it does not work.

    I do have an email alert which works but funnily enough (not sure if it's how it should be) if I add the SMS media as another Operation under trigger action the email does not work either. I did try to disable email completely and allow only SMS but that does not seem to work either.

    Any feedback would be much appreciated as I can't figure this one out. Thanks!
    Click image for larger version

Name:	image.png
Views:	259
Size:	21.4 KB
ID:	487284Click image for larger version

Name:	image.png
Views:	160
Size:	18.2 KB
ID:	487285Click image for larger version

Name:	image.png
Views:	156
Size:	49.2 KB
ID:	487286​​
  • Answer selected by dubfunkle at 22-07-2024, 18:32.
    dubfunkle
    Junior Member
    • May 2024
    • 11

    I just managed to make it work! I found someone on this forum with a similar issue, 4 years ago and basically what I did, I added again the SMS media type to the user where you add the recipients number, then all I had to do was go back to trigger actions, add the operation to send the SMS and finally, what i did not do before was to disable the trigger and re-enable it.

    Problem Solved.

    Comment

    • dubfunkle
      Junior Member
      • May 2024
      • 11

      #2
      Anyone who might shed some light?!

      Comment

      • dubfunkle
        Junior Member
        • May 2024
        • 11

        #3
        Sure thing.

        #!/usr/bin/php
        <?php
        require_once '/lib/zabbix/alertscripts/lib/Zabbix/Sms/Autoload.php';

        require 'config.php';

        use Zabbix\Sms AS ZS;

        ZS\Autoload::register(dirname(__FILE__) . '/lib');

        if (count($argv)<3) {
        die("Usage: {$argv[0]} [recipient] [subject] [message]\n");
        }

        try {
        $client = ZS\Factory::Get(GATEWAY_TYPE, GATEWAY_PARAMS);

        $client->send($argv[1], implode(':', [$argv[2], $argv[3]]));
        } catch (ZS\Exception $e) {
        echo $e->getMessage();
        }

        Comment

        • dubfunkle
          Junior Member
          • May 2024
          • 11

          #4
          I just managed to make it work! I found someone on this forum with a similar issue, 4 years ago and basically what I did, I added again the SMS media type to the user where you add the recipients number, then all I had to do was go back to trigger actions, add the operation to send the SMS and finally, what i did not do before was to disable the trigger and re-enable it.

          Problem Solved.

          Comment

          Working...