hook::CreateInterface After adding script, interface name become unknown

Started by hmjvaline, September 22, 2023, 05:43:14 PM

Previous topic - Next topic

hmjvaline

i use netxms server 4.4.2
after hook::CreateInterface add below script ,interface name and descript become unknown. why? 

if ($1->name ~= "(?i).*Teredo.*|.*isatap.*|.*Loopback.*|.*Bluetooth.*|Local Area Connection\* 12|Local Area Connection\* 11|Local Area Connection\* 9|Local Area Connection\* 8|Local Area Connection\* 2|6TO4 Adapter|sit0") {
  return false;
} else {
  return true;
}

Filipp Sudanov

Can you show a screenshot how these "unknown" name and description look like?
Is it so for all interfaces that are being created or for some (agent, snmp, with specific name?)
What if you try a simpler regex, without alternatives, would it change anything?


hmjvaline

In the attached file, I have attached normal and abnormal screenshots.

the normal interface display after I remove the script.

I only use the simplest snmp polling and agent. Before adding this script to the hook, 
interface name and description was normal without using any regular expressions.



hmjvaline

I'm sorry. I found that some interface names appear unknown not because of the hook script but because there is no appropriate snmp mib and agent installation. If the interface is only obtained through icmp and arp, it seems that only the unknown name can be obtained.

Filipp Sudanov

Yes, that's exactly how it works. If at some point server would be able to get info about interfaces from agent, this interface will be recreated with proper name.