mirror of
				https://github.com/Icinga/icinga2.git
				synced 2025-10-30 18:53:54 +01:00 
			
		
		
		
	
							parent
							
								
									d13871e233
								
							
						
					
					
						commit
						7a4fa25a49
					
				| @ -157,6 +157,7 @@ void HostsTable::AddColumns(Table *table, const String& prefix, | ||||
| 	table->AddColumn(prefix + "services", Column(&HostsTable::ServicesAccessor, objectAccessor)); | ||||
| 	table->AddColumn(prefix + "services_with_state", Column(&HostsTable::ServicesWithStateAccessor, objectAccessor)); | ||||
| 	table->AddColumn(prefix + "services_with_info", Column(&HostsTable::ServicesWithInfoAccessor, objectAccessor)); | ||||
| 	table->AddColumn(prefix + "check_source", Column(&HostsTable::CheckSourceAccessor, objectAccessor)); | ||||
| 	table->AddColumn(prefix + "is_reachable", Column(&HostsTable::IsReachableAccessor, objectAccessor)); | ||||
| } | ||||
| 
 | ||||
| @ -1483,6 +1484,21 @@ Value HostsTable::ServicesWithInfoAccessor(const Value& row) | ||||
| 	return services; | ||||
| } | ||||
| 
 | ||||
| Value HostsTable::CheckSourceAccessor(const Value& row) | ||||
| { | ||||
| 	Host::Ptr host = static_cast<Host::Ptr>(row); | ||||
| 
 | ||||
| 	if (!host) | ||||
| 		return Empty; | ||||
| 
 | ||||
| 	CheckResult::Ptr cr = host->GetLastCheckResult(); | ||||
| 
 | ||||
| 	if (cr) | ||||
| 		return cr->GetCheckSource(); | ||||
| 
 | ||||
| 	return Empty; | ||||
| } | ||||
| 
 | ||||
| Value HostsTable::IsReachableAccessor(const Value& row) | ||||
| { | ||||
| 	Host::Ptr host = static_cast<Host::Ptr>(row); | ||||
|  | ||||
| @ -140,6 +140,7 @@ protected: | ||||
| 	static Value ServicesAccessor(const Value& row); | ||||
| 	static Value ServicesWithStateAccessor(const Value& row); | ||||
| 	static Value ServicesWithInfoAccessor(const Value& row); | ||||
|         static Value CheckSourceAccessor(const Value& row); | ||||
|         static Value IsReachableAccessor(const Value& row); | ||||
| }; | ||||
| 
 | ||||
|  | ||||
| @ -505,6 +505,7 @@ New columns: | ||||
|   ----------|-------------- | ||||
|   hosts     | is_reachable | ||||
|   services  | is_reachable | ||||
|   hosts     | check_source | ||||
|   services  | check_source | ||||
|   downtimes | triggers | ||||
|   downtimes | trigger_time | ||||
|  | ||||
							
								
								
									
										4
									
								
								test/livestatus/queries/host/check
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								test/livestatus/queries/host/check
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,4 @@ | ||||
| GET hosts | ||||
| Columns: name plugin_output check_source | ||||
| ResponseHeader: fixed16 | ||||
| 
 | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user