mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
collect-wireless-mac: use function for notification
This commit is contained in:
parent
9d53c82d1c
commit
f262ff99a8
3 changed files with 12 additions and 9 deletions
|
@ -10,6 +10,8 @@
|
|||
:global "email-general-to";
|
||||
:global "email-general-cc";
|
||||
|
||||
:global SendNotification;
|
||||
|
||||
:local "place-before" [ / caps-man access-list find where comment="--- collected above ---" disabled ];
|
||||
:if ([ :len $"place-before" ] = 0) do={
|
||||
:error "Missing disabled access-list entry with comment '--- collected above ---'";
|
||||
|
@ -40,9 +42,8 @@
|
|||
$datetime . " connected to SSID " . $ssid . ", interface " . $interface);
|
||||
/ log info $message;
|
||||
/ caps-man access-list add place-before=$"place-before" comment=$message mac-address=$mac disabled=yes;
|
||||
/ tool e-mail send to=$"email-general-to" cc=$"email-general-cc" \
|
||||
subject=("[" . $identity . "] " . $mac . " connected to " . $ssid) \
|
||||
body=("A device with unknown MAC address connected to " . $ssid . " on " . $identity . ".\n\n" . \
|
||||
$SendNotification ("[" . $identity . "] " . $mac . " connected to " . $ssid) \
|
||||
("A device with unknown MAC address connected to " . $ssid . " on " . $identity . ".\n\n" . \
|
||||
"Controller: " . $identity . "\n" . \
|
||||
"Interface: " . $interface . "\n" . \
|
||||
"SSID: " . $ssid . "\n" . \
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
:global "email-general-to";
|
||||
:global "email-general-cc";
|
||||
|
||||
:global SendNotification;
|
||||
|
||||
:local "place-before" [ / interface wireless access-list find where comment="--- collected above ---" disabled ];
|
||||
:if ([ :len $"place-before" ] = 0) do={
|
||||
:error "Missing disabled access-list entry with comment '--- collected above ---'";
|
||||
|
@ -40,9 +42,8 @@
|
|||
$datetime . " connected to SSID " . $ssid . ", interface " . $interface);
|
||||
/ log info $message;
|
||||
/ interface wireless access-list add place-before=$"place-before" comment=$message mac-address=$mac disabled=yes;
|
||||
/ tool e-mail send to=$"email-general-to" cc=$"email-general-cc" \
|
||||
subject=("[" . $identity . "] " . $mac . " connected to " . $ssid) \
|
||||
body=("A device with unknown MAC address connected to " . $ssid . " on " . $identity . ".\n\n" . \
|
||||
$SendNotification ("[" . $identity . "] " . $mac . " connected to " . $ssid) \
|
||||
("A device with unknown MAC address connected to " . $ssid . " on " . $identity . ".\n\n" . \
|
||||
"Controller: " . $identity . "\n" . \
|
||||
"Interface: " . $interface . "\n" . \
|
||||
"SSID: " . $ssid . "\n" . \
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
:global "email-general-to";
|
||||
:global "email-general-cc";
|
||||
|
||||
:global SendNotification;
|
||||
|
||||
:local "place-before" [ / %PATH% access-list find where comment="--- collected above ---" disabled ];
|
||||
:if ([ :len $"place-before" ] = 0) do={
|
||||
:error "Missing disabled access-list entry with comment '--- collected above ---'";
|
||||
|
@ -42,9 +44,8 @@
|
|||
$datetime . " connected to SSID " . $ssid . ", interface " . $interface);
|
||||
/ log info $message;
|
||||
/ %PATH% access-list add place-before=$"place-before" comment=$message mac-address=$mac disabled=yes;
|
||||
/ tool e-mail send to=$"email-general-to" cc=$"email-general-cc" \
|
||||
subject=("[" . $identity . "] " . $mac . " connected to " . $ssid) \
|
||||
body=("A device with unknown MAC address connected to " . $ssid . " on " . $identity . ".\n\n" . \
|
||||
$SendNotification ("[" . $identity . "] " . $mac . " connected to " . $ssid) \
|
||||
("A device with unknown MAC address connected to " . $ssid . " on " . $identity . ".\n\n" . \
|
||||
"Controller: " . $identity . "\n" . \
|
||||
"Interface: " . $interface . "\n" . \
|
||||
"SSID: " . $ssid . "\n" . \
|
||||
|
|
Loading…
Reference in a new issue