Query e.g. all PCs with status 0 at 12:00 pm

Started by LBKRE, November 10, 2015, 10:01:23 AM

Previous topic - Next topic

LBKRE

Hello,
is there a easy way to find all nodes/PCs with a given Status at a given time?

Greetings

Ludger

tomaskir

#1
Probably easiest with a script.

This script assumes CheckTrustedNodes is set to 0 in server config variables.
Change searchStatus to what status you want to find.

Just a note - the script would probably not work if you are using Zones.


searchStatus = 4;

subs = GetObjectChildren(FindObject(1));

foreach (subnet : subs) {
  nodes = GetObjectChildren(subnet);
 
  foreach (node : nodes) {
    if (node->status == searchStatus)
      println("Node " . node->name . " has status " . searchStatus . ".");
  }
}



You could create a script DCI that will poll every 24hours (or at a custom schedule) that will keep the results.
You could even create multiple DCIs and send searchStatus as a parameter to the script to make it even more unified.

LBKRE

Really cool,
i am looking Forward to see Youtube Tutorials on nxsl an more of this cool things.

Thanx