2023年3月5日 星期日

Cacti + LINE Notify

 [root@rocky9 thold]# cat /etc/redhat-release 

Rocky Linux release 9.1 (Blue Onyx)

[root@rocky9 thold]# php -v 

PHP 7.4.33 (cli) (built: Feb 14 2023 09:05:10) ( NTS )

Copyright (c) The PHP Group

Zend Engine v3.4.0, Copyright (c) Zend Technologies

    with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies

[root@rocky9 thold]# mysql

Welcome to the MariaDB monitor.  Commands end with ; or \g.

Your MariaDB connection id is 2293

Server version: 10.5.16-MariaDB MariaDB Server


Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


MariaDB [(none)]> exit

Bye

[root@rocky9 thold]# 

=======================

Cacti ver 1.2.24

Thresholds 1.7

=======================

vi /var/www/html/cacti/plugins/thold/thold_functions.php


Row 5456 Insert :

    shell_exec("curl -X POST https://notify-api.line.me/api/notify -H 'Authorization: Bearer LineNotifyTokenXXXXXXXXXXXXXXXXXXXXXXXXXXXX' -F 'message=$subject \n\n'");







vi /var/www/html/cacti/lib/functions.php


Row 4705 Insert :

 shell_exec("curl -X POST https://notify-api.line.me/api/notify -H 'Authorization: Bearer LineNotifyTokenXXXXXXXXXXXXXXXXXXXXXXXXXXXX' -F 'message=$subject \n\n  $body'");










Advanced DEMO






沒有留言:

張貼留言