mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
collect-wireless-mac: add CNAME(s) in notification
This commit is contained in:
parent
4ddc6be585
commit
57c5c3f704
4 changed files with 24 additions and 8 deletions
|
@ -18,6 +18,7 @@
|
|||
|
||||
:global EitherOr;
|
||||
:global FormatLine;
|
||||
:global FormatMultiLines;
|
||||
:global GetMacVendor;
|
||||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
@ -58,7 +59,10 @@ $ScriptLock $0 false 10;
|
|||
:set DnsName "no dns name";
|
||||
:local DnsRec ([ /ip/dns/static/find where address=$Address ]->0);
|
||||
:if ([ :len $DnsRec ] > 0) do={
|
||||
:set DnsName [ /ip/dns/static/get $DnsRec name ];
|
||||
:set DnsName ({ [ /ip/dns/static/get $DnsRec name ] });
|
||||
:foreach CName in=[ /ip/dns/static/find where cname=($DnsName->0) ] do={
|
||||
:set DnsName ($DnsName, [ /ip/dns/static/get $CName name ]);
|
||||
}
|
||||
}
|
||||
}
|
||||
:local DateTime ([ /system/clock/get date ] . " " . [ /system/clock/get time ]);
|
||||
|
@ -77,7 +81,7 @@ $ScriptLock $0 false 10;
|
|||
[ $FormatLine "Vendor" $Vendor ] . "\n" . \
|
||||
[ $FormatLine "Hostname" $HostName ] . "\n" . \
|
||||
[ $FormatLine "Address" $Address ] . "\n" . \
|
||||
[ $FormatLine "DNS name" $DnsName ] . "\n" . \
|
||||
[ $FormatMultiLines "DNS name" $DnsName ] . "\n" . \
|
||||
[ $FormatLine "Date" $DateTime ]) });
|
||||
}
|
||||
} else={
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
:global EitherOr;
|
||||
:global FormatLine;
|
||||
:global FormatMultiLines;
|
||||
:global GetMacVendor;
|
||||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
@ -58,7 +59,10 @@ $ScriptLock $0 false 10;
|
|||
:set DnsName "no dns name";
|
||||
:local DnsRec ([ /ip/dns/static/find where address=$Address ]->0);
|
||||
:if ([ :len $DnsRec ] > 0) do={
|
||||
:set DnsName [ /ip/dns/static/get $DnsRec name ];
|
||||
:set DnsName ({ [ /ip/dns/static/get $DnsRec name ] });
|
||||
:foreach CName in=[ /ip/dns/static/find where cname=($DnsName->0) ] do={
|
||||
:set DnsName ($DnsName, [ /ip/dns/static/get $CName name ]);
|
||||
}
|
||||
}
|
||||
}
|
||||
:set ($RegVal->"ssid") [ /interface/wireless/get [ find where name=($RegVal->"interface") ] ssid ];
|
||||
|
@ -78,7 +82,7 @@ $ScriptLock $0 false 10;
|
|||
[ $FormatLine "Vendor" $Vendor ] . "\n" . \
|
||||
[ $FormatLine "Hostname" $HostName ] . "\n" . \
|
||||
[ $FormatLine "Address" $Address ] . "\n" . \
|
||||
[ $FormatLine "DNS name" $DnsName ] . "\n" . \
|
||||
[ $FormatMultiLines "DNS name" $DnsName ] . "\n" . \
|
||||
[ $FormatLine "Date" $DateTime ]) });
|
||||
}
|
||||
} else={
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
:global EitherOr;
|
||||
:global FormatLine;
|
||||
:global FormatMultiLines;
|
||||
:global GetMacVendor;
|
||||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
@ -73,7 +74,10 @@ $ScriptLock $0 false 10;
|
|||
:set DnsName "no dns name";
|
||||
:local DnsRec ([ /ip/dns/static/find where address=$Address ]->0);
|
||||
:if ([ :len $DnsRec ] > 0) do={
|
||||
:set DnsName [ /ip/dns/static/get $DnsRec name ];
|
||||
:set DnsName ({ [ /ip/dns/static/get $DnsRec name ] });
|
||||
:foreach CName in=[ /ip/dns/static/find where cname=($DnsName->0) ] do={
|
||||
:set DnsName ($DnsName, [ /ip/dns/static/get $CName name ]);
|
||||
}
|
||||
}
|
||||
}
|
||||
:set ($RegVal->"ssid") [ /interface/wireless/get [ find where name=($RegVal->"interface") ] ssid ];
|
||||
|
@ -95,7 +99,7 @@ $ScriptLock $0 false 10;
|
|||
[ $FormatLine "Vendor" $Vendor ] . "\n" . \
|
||||
[ $FormatLine "Hostname" $HostName ] . "\n" . \
|
||||
[ $FormatLine "Address" $Address ] . "\n" . \
|
||||
[ $FormatLine "DNS name" $DnsName ] . "\n" . \
|
||||
[ $FormatMultiLines "DNS name" $DnsName ] . "\n" . \
|
||||
[ $FormatLine "Date" $DateTime ]) });
|
||||
}
|
||||
} else={
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
:global EitherOr;
|
||||
:global FormatLine;
|
||||
:global FormatMultiLines;
|
||||
:global GetMacVendor;
|
||||
:global LogPrintExit2;
|
||||
:global ScriptLock;
|
||||
|
@ -58,7 +59,10 @@ $ScriptLock $0 false 10;
|
|||
:set DnsName "no dns name";
|
||||
:local DnsRec ([ /ip/dns/static/find where address=$Address ]->0);
|
||||
:if ([ :len $DnsRec ] > 0) do={
|
||||
:set DnsName [ /ip/dns/static/get $DnsRec name ];
|
||||
:set DnsName ({ [ /ip/dns/static/get $DnsRec name ] });
|
||||
:foreach CName in=[ /ip/dns/static/find where cname=($DnsName->0) ] do={
|
||||
:set DnsName ($DnsName, [ /ip/dns/static/get $CName name ]);
|
||||
}
|
||||
}
|
||||
}
|
||||
:local DateTime ([ /system/clock/get date ] . " " . [ /system/clock/get time ]);
|
||||
|
@ -77,7 +81,7 @@ $ScriptLock $0 false 10;
|
|||
[ $FormatLine "Vendor" $Vendor ] . "\n" . \
|
||||
[ $FormatLine "Hostname" $HostName ] . "\n" . \
|
||||
[ $FormatLine "Address" $Address ] . "\n" . \
|
||||
[ $FormatLine "DNS name" $DnsName ] . "\n" . \
|
||||
[ $FormatMultiLines "DNS name" $DnsName ] . "\n" . \
|
||||
[ $FormatLine "Date" $DateTime ]) });
|
||||
}
|
||||
} else={
|
||||
|
|
Loading…
Reference in a new issue