File tree Expand file tree Collapse file tree
roles/capture-performance-data/tasks Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313 {% for i in debian_suse_apache_deref_logs.results | default([]) + redhat_apache_deref_logs.results | default([]) %}
1414 --apache-log="{{ i.stat.path }}"
1515 {% endfor %}
16+ ignore_errors : yes
Original file line number Diff line number Diff line change 66import itertools
77import json
88import os
9- import psutil
109import re
1110import socket
1211import subprocess
1312import sys
14- import pymysql
13+
14+ try :
15+ import psutil
16+ except ImportError :
17+ psutil = None
18+ print ('No psutil, process information will not be included' ,
19+ file = sys .stderr )
20+
21+ try :
22+ import pymysql
23+ except ImportError :
24+ pymysql = None
25+ print ('No pymysql, database information will not be included' ,
26+ file = sys .stderr )
1527
1628# https://www.elastic.co/blog/found-crash-elasticsearch#mapping-explosion
1729
@@ -144,10 +156,10 @@ def get_report_info():
144156
145157 data = {
146158 'services' : get_services_stats (),
147- 'db' : args .db_pass and get_db_stats (args .db_host ,
148- args .db_user ,
149- args .db_pass ) or [],
150- 'processes' : get_processes_stats (args .process ),
159+ 'db' : pymysql and args .db_pass and get_db_stats (args .db_host ,
160+ args .db_user ,
161+ args .db_pass ) or [],
162+ 'processes' : psutil and get_processes_stats (args .process ) or [] ,
151163 'api' : get_http_stats (args .apache_log ),
152164 'report' : get_report_info (),
153165 }
You can’t perform that action at this time.
0 commit comments