mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-08-14 06:58:50 +02:00
collect-wireless-mac: use $SendNotification2
This commit is contained in:
parent
d6edf6c2d3
commit
1ca3e8b59f
3 changed files with 12 additions and 12 deletions
|
@ -17,7 +17,7 @@
|
||||||
:global GetMacVendor;
|
:global GetMacVendor;
|
||||||
:global LogPrintExit2;
|
:global LogPrintExit2;
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
:global SendNotification;
|
:global SendNotification2;
|
||||||
:global SymbolForNotification;
|
:global SymbolForNotification;
|
||||||
|
|
||||||
$ScriptLock $0;
|
$ScriptLock $0;
|
||||||
|
@ -56,8 +56,8 @@ $ScriptLock $0;
|
||||||
"first seen on " . $DateTime . " connected to SSID " . $Ssid . ", interface " . $Interface);
|
"first seen on " . $DateTime . " connected to SSID " . $Ssid . ", interface " . $Interface);
|
||||||
$LogPrintExit2 info $0 $Message false;
|
$LogPrintExit2 info $0 $Message false;
|
||||||
/ caps-man access-list add place-before=$PlaceBefore comment=$Message mac-address=$Mac disabled=yes;
|
/ caps-man access-list add place-before=$PlaceBefore comment=$Message mac-address=$Mac disabled=yes;
|
||||||
$SendNotification ([ $SymbolForNotification "mobile-phone" ] . $Mac . " connected to " . $Ssid) \
|
$SendNotification2 ({ subject=([ $SymbolForNotification "mobile-phone" ] . $Mac . " connected to " . $Ssid); \
|
||||||
("A device with unknown MAC address connected to " . $Ssid . " on " . $Identity . ".\n\n" . \
|
message=("A device with unknown MAC address connected to " . $Ssid . " on " . $Identity . ".\n\n" . \
|
||||||
"Controller: " . $Identity . "\n" . \
|
"Controller: " . $Identity . "\n" . \
|
||||||
"Interface: " . $Interface . "\n" . \
|
"Interface: " . $Interface . "\n" . \
|
||||||
"SSID: " . $Ssid . "\n" . \
|
"SSID: " . $Ssid . "\n" . \
|
||||||
|
@ -66,7 +66,7 @@ $ScriptLock $0;
|
||||||
"Hostname: " . $HostName . "\n" . \
|
"Hostname: " . $HostName . "\n" . \
|
||||||
"Address: " . $Address . "\n" . \
|
"Address: " . $Address . "\n" . \
|
||||||
"DNS name: " . $DnsName . "\n" . \
|
"DNS name: " . $DnsName . "\n" . \
|
||||||
"Date: " . $DateTime);
|
"Date: " . $DateTime) });
|
||||||
} else={
|
} else={
|
||||||
$LogPrintExit2 debug $0 ("MAC address " . $Mac . " already known: " . \
|
$LogPrintExit2 debug $0 ("MAC address " . $Mac . " already known: " . \
|
||||||
[ / caps-man access-list get $AccessList comment ]) false;
|
[ / caps-man access-list get $AccessList comment ]) false;
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
:global GetMacVendor;
|
:global GetMacVendor;
|
||||||
:global LogPrintExit2;
|
:global LogPrintExit2;
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
:global SendNotification;
|
:global SendNotification2;
|
||||||
:global SymbolForNotification;
|
:global SymbolForNotification;
|
||||||
|
|
||||||
$ScriptLock $0;
|
$ScriptLock $0;
|
||||||
|
@ -56,8 +56,8 @@ $ScriptLock $0;
|
||||||
"first seen on " . $DateTime . " connected to SSID " . $Ssid . ", interface " . $Interface);
|
"first seen on " . $DateTime . " connected to SSID " . $Ssid . ", interface " . $Interface);
|
||||||
$LogPrintExit2 info $0 $Message false;
|
$LogPrintExit2 info $0 $Message false;
|
||||||
/ interface wireless access-list add place-before=$PlaceBefore comment=$Message mac-address=$Mac disabled=yes;
|
/ interface wireless access-list add place-before=$PlaceBefore comment=$Message mac-address=$Mac disabled=yes;
|
||||||
$SendNotification ([ $SymbolForNotification "mobile-phone" ] . $Mac . " connected to " . $Ssid) \
|
$SendNotification2 ({ subject=([ $SymbolForNotification "mobile-phone" ] . $Mac . " connected to " . $Ssid); \
|
||||||
("A device with unknown MAC address connected to " . $Ssid . " on " . $Identity . ".\n\n" . \
|
message=("A device with unknown MAC address connected to " . $Ssid . " on " . $Identity . ".\n\n" . \
|
||||||
"Controller: " . $Identity . "\n" . \
|
"Controller: " . $Identity . "\n" . \
|
||||||
"Interface: " . $Interface . "\n" . \
|
"Interface: " . $Interface . "\n" . \
|
||||||
"SSID: " . $Ssid . "\n" . \
|
"SSID: " . $Ssid . "\n" . \
|
||||||
|
@ -66,7 +66,7 @@ $ScriptLock $0;
|
||||||
"Hostname: " . $HostName . "\n" . \
|
"Hostname: " . $HostName . "\n" . \
|
||||||
"Address: " . $Address . "\n" . \
|
"Address: " . $Address . "\n" . \
|
||||||
"DNS name: " . $DnsName . "\n" . \
|
"DNS name: " . $DnsName . "\n" . \
|
||||||
"Date: " . $DateTime);
|
"Date: " . $DateTime) });
|
||||||
} else={
|
} else={
|
||||||
$LogPrintExit2 debug $0 ("MAC address " . $Mac . " already known: " . \
|
$LogPrintExit2 debug $0 ("MAC address " . $Mac . " already known: " . \
|
||||||
[ / interface wireless access-list get $AccessList comment ]) false;
|
[ / interface wireless access-list get $AccessList comment ]) false;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
:global GetMacVendor;
|
:global GetMacVendor;
|
||||||
:global LogPrintExit2;
|
:global LogPrintExit2;
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
:global SendNotification;
|
:global SendNotification2;
|
||||||
:global SymbolForNotification;
|
:global SymbolForNotification;
|
||||||
|
|
||||||
$ScriptLock $0;
|
$ScriptLock $0;
|
||||||
|
@ -58,8 +58,8 @@ $ScriptLock $0;
|
||||||
"first seen on " . $DateTime . " connected to SSID " . $Ssid . ", interface " . $Interface);
|
"first seen on " . $DateTime . " connected to SSID " . $Ssid . ", interface " . $Interface);
|
||||||
$LogPrintExit2 info $0 $Message false;
|
$LogPrintExit2 info $0 $Message false;
|
||||||
/ %PATH% access-list add place-before=$PlaceBefore comment=$Message mac-address=$Mac disabled=yes;
|
/ %PATH% access-list add place-before=$PlaceBefore comment=$Message mac-address=$Mac disabled=yes;
|
||||||
$SendNotification ([ $SymbolForNotification "mobile-phone" ] . $Mac . " connected to " . $Ssid) \
|
$SendNotification2 ({ subject=([ $SymbolForNotification "mobile-phone" ] . $Mac . " connected to " . $Ssid); \
|
||||||
("A device with unknown MAC address connected to " . $Ssid . " on " . $Identity . ".\n\n" . \
|
message=("A device with unknown MAC address connected to " . $Ssid . " on " . $Identity . ".\n\n" . \
|
||||||
"Controller: " . $Identity . "\n" . \
|
"Controller: " . $Identity . "\n" . \
|
||||||
"Interface: " . $Interface . "\n" . \
|
"Interface: " . $Interface . "\n" . \
|
||||||
"SSID: " . $Ssid . "\n" . \
|
"SSID: " . $Ssid . "\n" . \
|
||||||
|
@ -68,7 +68,7 @@ $ScriptLock $0;
|
||||||
"Hostname: " . $HostName . "\n" . \
|
"Hostname: " . $HostName . "\n" . \
|
||||||
"Address: " . $Address . "\n" . \
|
"Address: " . $Address . "\n" . \
|
||||||
"DNS name: " . $DnsName . "\n" . \
|
"DNS name: " . $DnsName . "\n" . \
|
||||||
"Date: " . $DateTime);
|
"Date: " . $DateTime) });
|
||||||
} else={
|
} else={
|
||||||
$LogPrintExit2 debug $0 ("MAC address " . $Mac . " already known: " . \
|
$LogPrintExit2 debug $0 ("MAC address " . $Mac . " already known: " . \
|
||||||
[ / %PATH% access-list get $AccessList comment ]) false;
|
[ / %PATH% access-list get $AccessList comment ]) false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue