#include "icinga/checkresultmessage.h"
#include "icinga/downtimemessage.h"
#include "icinga/service.h"
+#include "icinga/checkcommand.h"
#include "icinga/notification.h"
#include "icinga/notificationmessage.h"
#include "icinga/macroprocessor.h"
*/
void CompatLog::NotificationSentRequestHandler(const RequestMessage& request)
{
- Log(LogWarning, "compat", "Got notification");
-
NotificationMessage params;
if (!request.GetParams(¶ms))
return;
String svcname = params.GetService();
Service::Ptr service = Service::GetByName(svcname);
- Log(LogWarning, "compat", "Got notification for service" + svcname);
-
Host::Ptr host = service->GetHost();
if (!host)
String author = params.GetAuthor();
String comment_text = params.GetCommentText();
+ CheckCommand::Ptr commandObj = service->GetCheckCommand();
+
+ String check_command = "";
+ if (commandObj)
+ check_command = commandObj->GetName();
+
NotificationType notification_type = params.GetType();
String notification_type_str = Notification::NotificationTypeToString(notification_type);
<< service->GetShortName() << ";"
<< notification_type_str << " "
<< "(" << Service::StateToString(service->GetState()) << ");"
- << service->GetCheckCommandName() << ";"
+ << check_command << ";"
<< raw_output << author_comment
<< "";
<< host->GetName() << ";"
<< notification_type_str << " "
<< "(" << Service::StateToString(service->GetState()) << ");"
- << service->GetCheckCommandName() << ";"
+ << check_command << ";"
<< raw_output << author_comment
<< "";