Closed longhornwhistler closed 7 months ago
Issue lies with the JSON returned with current Network App 8.0+ - if you have NOT manually set a connected client name in the UI Network App, then that field is never returned. Update the LLD MARCO #NAME in the template for Wired and Wireless clients discovery to 'hostname' field. Now issue is if you do manually set a name in clients then hostname is returned as "" (blank/empty) and name field is generated. I'm trying to work on a way to basically do an IF/THEN with LLD to fix this but don't know if it's possible. IF hostname ="" then parse 'name' field for LLD MACRO #NAME.
Hope this helps the 99% it did for me...... excellent work on this template btw!
Hi @cawhite6, thanks for your report, any help is appreciated. One way to solve this issue could be adding a simple custom JavaScript at preprocessing stage on the discovery rule. The script need to check if name is defined and in case it isn't it define name with hostname value.
Hello,
I've just set up the template, and I'm facing the same issue, with the following specifications:
But I also have another issue that might be related. I'm missing 2 switches in the discovery, and I found these errors:
I have fixed the issue with empty {#NAME} LDD macron on c8f653f8e65a536b93f59331645733bdc4e6e406. I have solved that with a Custom JavaScript that define 'name' value with 'hostname' if undefined.
@ketomagasaki Is your USW device containing '{' character?
Thank you for the correction c8f653f, I no longer have the client value with {#NAME} 😊
No, the names of the 2 missing USWs are:
I posted here because the error message is Cannot create host "Unifi USW {#NAME}": name contains invalid character '{
. So, since there's also an issue with {#NAME}, I thought it might be the same problem.
I analyzed the API call and indeed for these 2 USWs, there is no name returned.
I simply changed their names and then put back the original ones, now their names appear in the JSON. A bug in the API apparently 🤔
It's good for me, thank you for your help 👍
Released version c8f653f containing the fix.
Checklist
Describe the Bug
Clients are showing as {#NAME} instead of the actual client name.
MACROS
Context