externalcommands */
| 1453 | |
| 1454 | /* externalcommands */ |
| 1455 | void DbEvents::AddExternalCommandHistory(double time, const String& command, const std::vector<String>& arguments) |
| 1456 | { |
| 1457 | DbQuery query1; |
| 1458 | query1.Table = "externalcommands"; |
| 1459 | query1.Type = DbQueryInsert; |
| 1460 | query1.Category = DbCatExternalCommand; |
| 1461 | |
| 1462 | Dictionary::Ptr fields1 = new Dictionary(); |
| 1463 | |
| 1464 | fields1->Set("entry_time", DbValue::FromTimestamp(time)); |
| 1465 | fields1->Set("command_type", MapExternalCommandType(command)); |
| 1466 | fields1->Set("command_name", command); |
| 1467 | fields1->Set("command_args", boost::algorithm::join(arguments, ";")); |
| 1468 | fields1->Set("instance_id", 0); /* DbConnection class fills in real ID */ |
| 1469 | |
| 1470 | Endpoint::Ptr endpoint = Endpoint::GetByName(IcingaApplication::GetInstance()->GetNodeName()); |
| 1471 | |
| 1472 | if (endpoint) |
| 1473 | fields1->Set("endpoint_object_id", endpoint); |
| 1474 | |
| 1475 | query1.Fields = fields1; |
| 1476 | DbObject::OnQuery(query1); |
| 1477 | } |
| 1478 | |
| 1479 | int DbEvents::GetHostState(const Host::Ptr& host) |
| 1480 | { |
nothing calls this directly
no test coverage detected