Forum posts for conhost.exe

How to count number of strings in a list

My needs check windows process number.

import sys
import os
import commands

ip = sys.argv[5]
val = sys.argv[1]
oid = 'HOST-RESOURCES-MIB::hrSWRunName'
cmd = 'snmpwalk -v 2c -c public %s %s' % (ip,oid)
(r_c,r_e) = commands.getstatusoutput(cmd)
if r_c != 0:
print 'C - snmpwalk is Error.'
else:
for i in r_e.split(' '):
a = i.split(':')[-1].strip(' '')
print a


Result?

conhost.exe
conhost.exe
conhost.exe
conhost.exe
fdhost.exe
cmd.exe
fdhost.exe


I hope the result is. I do not know how to achieve it.

if sys.argv[1] <5:#count(conhost.exe)
print 'critical -'
else:
print 'OK - '


How the statistics of my results? conhost.exe 4 conhost.exe 1 conhost.exe 1

View complete forum thread with replies

Other posts related to conhost.exe

See Related Forum Messages: Follow the Links Below to View Complete Thread

Why is conhost.exe being launched?
Python on windows - conhost.exe CPU usage
C# Multiple processes conhost.exe while using UDP
Rails server running in command prompt causing conhost.exe to crash
&ldquo;plink.exe&rdquo; hangs on Windows Server 2008 R2 , creates process &ldquo;conhost.exe&rdquo;
How to count number of strings in a list
Conhost process stays opens
How would I redirect console output for all applications a application I launch using a Process
Java - Get specific word from string [closed]
Get PID of conhost.exe associated to my console process

What is the carbon footprint of your coffee?

Is it low? Is it high? Can this things really kill the planet Earth? Maybe the answer will surprise you. Maybe not.