NetXMS Support Forum

English Support => General Support => Topic started by: hmjvaline on September 22, 2023, 05:43:14 PM

Title: hook::CreateInterface After adding script, interface name become unknown
Post by: hmjvaline on September 22, 2023, 05:43:14 PM
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;
}
Title: Re: hook::CreateInterface After adding script, interface name become unknown
Post by: Filipp Sudanov on September 22, 2023, 07:02:54 PM
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?

Title: Re: hook::CreateInterface After adding script, interface name become unknown
Post by: hmjvaline on September 23, 2023, 12:30:00 PM
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.


Title: Re: hook::CreateInterface After adding script, interface name become unknown
Post by: hmjvaline on September 23, 2023, 01:33:00 PM
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.
Title: Re: hook::CreateInterface After adding script, interface name become unknown
Post by: Filipp Sudanov on September 25, 2023, 01:31:56 PM
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.