File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -144,20 +144,25 @@ def run():
144144 check .add_message (Status .CRITICAL , f"{ name } tools not running" )
145145 logging .debug (f"{ name } tools not running" )
146146 else :
147+ vmname = name
147148 perf_data ["VMware Tools running" ] += 1
148149
149150 for key , value in perf_data .items ():
150151 check .add_perfdata (label = key , value = value , uom = "" )
151152
152- (code , message ) = check .check_messages (separator = "\n " , separator_all = "\n " )
153+ (code , message ) = check .check_messages (separator = "\n " )
154+
155+ if (vmscnt > 1 ):
156+ message = f"{ vmscnt } VMs checked for VMware Tools state, { len (vms ) - vmscnt } VMs ignored"
157+ else :
158+ if (code == Status .OK ):
159+ message = f"{ vmname } tools running"
160+
153161 check .exit (
154162 code = code ,
155- message = f"{ vmscnt } VMs checked for VMware Tools state, { len (vms ) - vmscnt } VMs ignored"
156- if code == Status .OK
157- else message ,
163+ message = message ,
158164 )
159165
160-
161166if __name__ == "__main__" :
162167 try :
163168 run ()
You can’t perform that action at this time.
0 commit comments