{
BOOST_ASSERT( 0 <= hosts_down_limit );
BOOST_ASSERT( 0 <= link_up_interval_in_min );
- BOOST_ASSERT( !status_notifier_cmd.empty() );
}
LinkStatusAnalyzer::~LinkStatusAnalyzer()
BOOST_ASSERT( CurrentLinkStatus == LinkStatus_Up );
BOOST_ASSERT( CurrentNotificationStatus == NotificationStatus_NotReported );
- bool replaced = StatusNotifierCmd.set_token_value(
+ StatusNotifierCmd.set_token_value(
StatusNotifierCommand::StatusToken,
"up"
- );
+ ); //lint !e534
bool executed = StatusNotifierCmd.execute();
- if ( replaced && executed )
+ if ( executed )
{
CurrentNotificationStatus = NotificationStatus_Reported;
}
BOOST_ASSERT( CurrentLinkStatus == LinkStatus_Down );
BOOST_ASSERT( CurrentNotificationStatus == NotificationStatus_NotReported );
- bool replaced = StatusNotifierCmd.set_token_value(
+ StatusNotifierCmd.set_token_value(
StatusNotifierCommand::StatusToken,
"down"
- );
+ ); //lint !e534
bool executed = StatusNotifierCmd.execute();
- if ( replaced && executed )
+ if ( executed )
{
CurrentNotificationStatus = NotificationStatus_Reported;
}
{
BOOST_ASSERT( !token.empty() );
BOOST_ASSERT( !value.empty() );
- BOOST_ASSERT( !CommandStr.empty() );
const size_t token_begin_pos = CommandStr.find( token );
if ( token_begin_pos == string::npos )
bool StatusNotifierCommand::execute() const
{
- BOOST_ASSERT( !CommandStr.empty() );
+ // Check if users wants notification at all
+ if (CommandStr.empty())
+ return true;
string app = get_application_string();
string args = get_arguments_string();