Creating groups of servers based on whether network card is DHCP or static.
Hello,
In my current environment of servers some are Static and others are DHCP. I am looking to create a groups based on whether a server's network card is using a static IP address or DHCP. I noticed in the inventory section of Kace that the detail page for every machine has a NIC section that shows you whether or not your NIC is DHCP or Static. But when I go to create a smart label, there is no filter that includes the NIC as a parameter. Has anyone been able to write a script that can query each machine for its NIC details?
3 Comments
[ + ] Show comments
-
Thank You flip1001. This query worked great. I ran it under the reporting portion of my Kace appliance as a SQL command. Thanks Again! - kyhec7249 9 years ago
-
Well, actually I created a smart label and then replaced the SQL in the smart label with the answer I posted. - flip1001 9 years ago
-
OK that works too and gives me real time results. Thank You! - kyhec7249 9 years ago
Answers (1)
Answer Summary:
Please log in to answer
Posted by:
flip1001
9 years ago
Change DHCP Enabled to True or False and also change the IP to what your network uses. I put an IP otherwise you might pickup on virtual nics.
SELECT MACHINE.NAME AS SYSTEM_NAME, SYSTEM_DESCRIPTION, MACHINE.IP, MACHINE.MAC, MACHINE.ID as TOPIC_ID FROM MACHINE
WHERE (1 in (SELECT 1 FROM MACHINE_NICS WHERE MACHINE.ID = MACHINE_NICS.ID AND MACHINE_NICS.DHCP_ENABLED = 'False' AND MACHINE_NICS.IP LIKE '172.16.%'))
AND MACHINE.OS_NAME LIKE '%SERVER%'