Discovery time – converted to seconds

In answer to a recent question.. Here's an example ASL script that shows one way to determine the number of seconds it took to discover each system in the IP repository..
START { .. eol } do {
    foreach ucsName (getInstances("UnitaryComputerSystem")) {
        str = object(ucsName)->DiscoveryTime;
        secs = TOSECS(str);
        print(ucsName." - ".str." - ".secs);
    }
}
TOSECS(timestr) {
    local days; local hours; local mins; local secs;
    input = timestr;
    days: integer
    hours: integer ":"
    mins: integer ":"
    secs: integer
    eol
} do {
    return ((days*24 + hours)*60 + mins)*60 + secs;
}
Scroll to Top