-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoolstest.py
More file actions
34 lines (34 loc) · 1.31 KB
/
Copy pathtoolstest.py
File metadata and controls
34 lines (34 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import os
import subprocess
import platform
opsname=platform.system()
def tanium_agent_check():
'''Checks Whether Tanium agent is installed or not'''
if opsname=="Linux":
tanium_check=subprocess.call('rpm -qa | grep -i Tanium TaniumClient-6.0.314.1442-1.x86_64',shell=True)
if tanium_check==True:
print("Tanium agent is installed")
def Tanium_status_check():
''''checks whether tanium agent is ruuning is ruuning or not'''
if subprocess.call('ps -ef | grep -i tanium | grep -v grep',shell=True):
print("Tanium agent is running")
else:
print("Tanium agent is not running")
Tanium_status_check()
else:
print("Tanium agent is not installed")
elif opsname=="Aix":
tanium_check=subprocess.call('lslpp -l TaniumClient',shell=True)
if tanium_check==True:
print("Tanium agent is installed")
Tanium_status_check()
else:
print("Tanium agent is not installed")
elif opsname=="Solaris":
tanium_check=subprocess.call('pkginfo -i TaniumClient',shell=True)
if tanium_check==True:
print("Tanium agent is installed")
Tanium_status_check()
else:
print("Tanium agent is not installed")
tanium_agent_check()