diff --git a/collect-wireless-mac.capsman b/collect-wireless-mac.capsman index 0cf10a7..0373982 100644 --- a/collect-wireless-mac.capsman +++ b/collect-wireless-mac.capsman @@ -55,9 +55,10 @@ $ScriptLock $0 false 10; :if ([ :len $HostName ] = 0) do={ :set HostName "no hostname"; } - :set DnsName [ / ip dns static get ([ find where address=$Address ]->0) name ]; - :if ([ :len $DnsName ] = 0) do={ - :set DnsName "no dns name"; + :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 ]; } } :local DateTime ([ / system clock get date ] . " " . [ / system clock get time ]); diff --git a/collect-wireless-mac.local b/collect-wireless-mac.local index 41fe296..109ec5c 100644 --- a/collect-wireless-mac.local +++ b/collect-wireless-mac.local @@ -55,9 +55,10 @@ $ScriptLock $0 false 10; :if ([ :len $HostName ] = 0) do={ :set HostName "no hostname"; } - :set DnsName [ / ip dns static get ([ find where address=$Address ]->0) name ]; - :if ([ :len $DnsName ] = 0) do={ - :set DnsName "no dns name"; + :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 ($RegVal->"ssid") [ / interface wireless get [ find where name=($RegVal->"interface") ] ssid ]; diff --git a/collect-wireless-mac.template b/collect-wireless-mac.template index 9b817a4..e8579f0 100644 --- a/collect-wireless-mac.template +++ b/collect-wireless-mac.template @@ -56,9 +56,10 @@ $ScriptLock $0 false 10; :if ([ :len $HostName ] = 0) do={ :set HostName "no hostname"; } - :set DnsName [ / ip dns static get ([ find where address=$Address ]->0) name ]; - :if ([ :len $DnsName ] = 0) do={ - :set DnsName "no dns name"; + :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 ($RegVal->"ssid") [ / interface wireless get [ find where name=($RegVal->"interface") ] ssid ];