Monitor power from other nodes via LAN
This commit is contained in:
		
							parent
							
								
									04c2974a8e
								
							
						
					
					
						commit
						49153acfbd
					
				
							
								
								
									
										13
									
								
								m/hut/ipmi.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								m/hut/ipmi.yml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,13 @@ | ||||
| modules: | ||||
|         default: | ||||
|                 collectors: | ||||
|                 - bmc | ||||
|                 - ipmi | ||||
|                 - chassis | ||||
| 
 | ||||
|         lan: | ||||
|                 collectors: | ||||
|                 - ipmi | ||||
|                 - chassis | ||||
|                 user: "" | ||||
|                 pass: "" | ||||
| @ -42,9 +42,13 @@ | ||||
|   services.prometheus = { | ||||
| 
 | ||||
|     exporters = { | ||||
|       ipmi.enable = true; | ||||
|       ipmi.group = "root"; | ||||
|       ipmi.user = "root"; | ||||
|       ipmi = { | ||||
|         enable = true; | ||||
|         group = "root"; | ||||
|         user = "root"; | ||||
|         configFile = ./ipmi.yml; | ||||
|         #extraFlags = [ "--log.level=debug" ]; | ||||
|       }; | ||||
|       node = { | ||||
|         enable = true; | ||||
|         enabledCollectors = [ "systemd" ]; | ||||
| @ -66,6 +70,58 @@ | ||||
|           ]; | ||||
|         }]; | ||||
|       } | ||||
|       { | ||||
|         # Scrape the IPMI info of the hosts remotely via LAN | ||||
|         job_name = "ipmi-lan"; | ||||
|         scrape_interval = "1m"; | ||||
|         scrape_timeout = "30s"; | ||||
|         metrics_path = "/ipmi"; | ||||
|         scheme = "http"; | ||||
|         relabel_configs = [ | ||||
|           { | ||||
|             # Takes the address and sets it in the "target=<xyz>" URL parameter | ||||
|             source_labels = [ "__address__" ]; | ||||
|             separator = ";"; | ||||
|             regex = "(.*)(:80)?"; | ||||
|             target_label = "__param_target"; | ||||
|             replacement = "\${1}"; | ||||
|             action = "replace"; | ||||
|           } | ||||
|           { | ||||
|             # Sets the "instance" label with the remote host we are querying | ||||
|             source_labels = [ "__param_target" ]; | ||||
|             separator = ";"; | ||||
|             regex = "(.*)"; | ||||
|             target_label = "instance"; | ||||
|             replacement = "\${1}"; | ||||
|             action = "replace"; | ||||
|           } | ||||
|           { | ||||
|             # Sets the fixed "module=lan" URL param | ||||
|             separator = ";"; | ||||
|             regex = "(.*)"; | ||||
|             target_label = "__param_module"; | ||||
|             replacement = "lan"; | ||||
|             action = "replace"; | ||||
|           } | ||||
|           { | ||||
|             # Sets the target to query as the localhost IPMI exporter | ||||
|             separator = ";"; | ||||
|             regex = ".*"; | ||||
|             target_label = "__address__"; | ||||
|             replacement = "127.0.0.1:9290"; | ||||
|             action = "replace"; | ||||
|           } | ||||
|         ]; | ||||
| 
 | ||||
|         # Load the list of targets from another file | ||||
|         file_sd_configs = [ | ||||
|           { | ||||
|             files = [ "${./targets.yml}" ]; | ||||
|             refresh_interval = "30s"; | ||||
|           } | ||||
|         ]; | ||||
|       } | ||||
|     ]; | ||||
|   }; | ||||
| } | ||||
|  | ||||
							
								
								
									
										11
									
								
								m/hut/targets.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								m/hut/targets.yml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,11 @@ | ||||
| - targets: | ||||
|   - 10.0.40.101 | ||||
|   - 10.0.40.102 | ||||
|   - 10.0.40.103 | ||||
|   - 10.0.40.104 | ||||
|   - 10.0.40.105 | ||||
|   - 10.0.40.106 | ||||
|   - 10.0.40.107 | ||||
|   - 10.0.40.108 | ||||
|   labels: | ||||
|     job: ipmi-lan | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user