Hi,
I´m looking for any way to unmanaged nodes using sql query.
You could do it with a SQL Agent job.
However, there is an easier way to do it.
NPM includes an "Unmanage schedule" utility. This wizard based util creates an object that you run as a scheduled task on the NPM server and it accomplishes what you're seeking.
I found this on Thwack, but is there any way to create a schedule in SQL ? (to run this command everyday at 23:00)
Use NetPerfMon;
UPDATE dbo.Interfaces SET Unmanaged = 1, UnManageFrom=GETDATE(), UnManageUntil=DATEADD(year, 1, GETDATE())
WHERE Fullname like 'BuildingE_Switch%'
Could you show me a working version of that script with the date/s built into it?
I have never found an answer to this. Unfortunately, the unmanage node utility is and always has been garbage. It just doesn't work consistently. What I do is create a fake SMTP server (127.0.0.1) and then I wrote a SQL query to switch that to the default SMTP server during maintenance, then I reboot my polling engines at the end of maintenance and put my SMTP server back to the real one. Not pretty, but works better than the built in utility.