Compare commits
	
		
			3 commits
		
	
	
		
			706c4028f8
			...
			c8b7e34732
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | c8b7e34732 | ||
|   | bb6eeba6fb | ||
|   | 6c2d4ca69f | 
					 4 changed files with 27 additions and 9 deletions
				
			
		|  | @ -33,3 +33,5 @@ then | ||||||
|   journalctl INVOCATION_ID="$InvocationID" --output cat |   journalctl INVOCATION_ID="$InvocationID" --output cat | ||||||
| fi | fi | ||||||
| ``` | ``` | ||||||
|  | 
 | ||||||
|  | telegraf: execd for daemons | ||||||
|  |  | ||||||
|  | @ -2,7 +2,9 @@ | ||||||
| 
 | 
 | ||||||
| date=$(date --utc +%s%N) | date=$(date --utc +%s%N) | ||||||
| 
 | 
 | ||||||
| for metric in TIMELEFT LOADPCT BCHARGE | METRICS=$(apcaccess) | ||||||
|  | 
 | ||||||
|  | for METRIC in TIMELEFT LOADPCT BCHARGE | ||||||
| do | do | ||||||
|   echo "apcupsd $metric=$(apcaccess -p $metric | cut -d' ' -f1) $date" |   echo "apcupsd $METRIC=$(grep $METRIC <<< $METRICS | cut -d ':' -f 2 | xargs | cut -d ' ' -f 1 ) $date" | ||||||
| done | done | ||||||
|  |  | ||||||
|  | @ -20,6 +20,11 @@ files = { | ||||||
|         'source': f"https://dl.sublimity.de/telegraf-procio/telegraf-procio-{node.metadata.get('system/architecture')}-latest", |         'source': f"https://dl.sublimity.de/telegraf-procio/telegraf-procio-{node.metadata.get('system/architecture')}-latest", | ||||||
|         'mode': '0755', |         'mode': '0755', | ||||||
|     }, |     }, | ||||||
|  |     '/usr/local/share/telegraf/pressure_stall': { | ||||||
|  |         'content_type': 'download', | ||||||
|  |         'source': f"https://dl.sublimity.de/telegraf-pressure-stall/telegraf-pressure-stall-{node.metadata.get('system/architecture')}-latest", | ||||||
|  |         'mode': '0755', | ||||||
|  |     }, | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| svc_systemd['telegraf'] = { | svc_systemd['telegraf'] = { | ||||||
|  |  | ||||||
|  | @ -52,13 +52,22 @@ defaults = { | ||||||
|                 'swap': {h({})}, |                 'swap': {h({})}, | ||||||
|                 'system': {h({})}, |                 'system': {h({})}, | ||||||
|                 'net': {h({})}, |                 'net': {h({})}, | ||||||
|                 'exec': {h({ |                 'exec': { | ||||||
|  |                     h({ | ||||||
|                         'commands': [ |                         'commands': [ | ||||||
|                             f'sudo /usr/local/share/telegraf/procio', |                             f'sudo /usr/local/share/telegraf/procio', | ||||||
|                         ], |                         ], | ||||||
|                         'data_format': 'influx', |                         'data_format': 'influx', | ||||||
|                         'interval': '20s', |                         'interval': '20s', | ||||||
|                 })}, |                     }), | ||||||
|  |                     h({ | ||||||
|  |                         'commands': [ | ||||||
|  |                             f'/usr/local/share/telegraf/pressure_stall', | ||||||
|  |                         ], | ||||||
|  |                         'data_format': 'influx', | ||||||
|  |                         'interval': '10s', | ||||||
|  |                     }), | ||||||
|  |                 }, | ||||||
|             }, |             }, | ||||||
|         }, |         }, | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue