MCPcopy Create free account
hub / github.com/Icinga/icinga2 / AddExternalCommandHistory

Method AddExternalCommandHistory

lib/db_ido/dbevents.cpp:1455–1477  ·  view source on GitHub ↗

externalcommands */

Source from the content-addressed store, hash-verified

1453
1454/* externalcommands */
1455void 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
1479int DbEvents::GetHostState(const Host::Ptr& host)
1480{

Callers

nothing calls this directly

Calls 2

GetNodeNameMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected