Changeset b7d17f8 in nscp for modules


Ignore:
Timestamp:
04/11/11 06:33:49 (2 years ago)
Author:
Michael Medin <michael@…>
Branches:
master, 0.4.0, 0.4.1, 0.4.2
Children:
d66ccee
Parents:
c391984
Message:

0.4.x: Major update with a lot of fixes and what not.
Now NSCA is working with old config file as well as a brand new http settings store and many many other fixes.

Location:
modules
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • modules/CheckDisk/filter.cpp

    r1f24a1c rb7d17f8  
    3535      (_T("accessed"), (type_date)) 
    3636      (_T("written"), (type_date)) 
    37       (_T("generated"), (type_date)); 
     37      (_T("created"), (type_date)); 
    3838  } 
    3939 
     
    7777  else if (key == _T("line_count")) 
    7878    ret = &object_type::get_line_count; 
    79   else if (key == _T("access")) 
     79  else if (key == _T("accessed")) 
    8080    ret = &object_type::get_access; 
    81   else if (key == _T("creation")) 
     81  else if (key == _T("created")) 
    8282    ret = &object_type::get_creation; 
    8383  else if (key == _T("written")) 
  • modules/NSCAAgent/NSCAAgent.cpp

    rc760fc9 rb7d17f8  
    149149NSCAPI::nagiosReturn NSCAAgent::handleSimpleNotification(const std::wstring channel, const std::wstring command, NSCAPI::nagiosReturn code, std::wstring msg, std::wstring perf) { 
    150150  try { 
    151     NSC_DEBUG_MSG_STD(_T("* * *NSCA * * * Handling command: ") + command); 
    152151    boost::asio::io_service io_service; 
    153     NSC_DEBUG_MSG_STD(_T("* * *NSCA * * * message: ") + msg); 
    154     NSC_DEBUG_MSG_STD(_T("* * *NSCA * * * performance: ") + perf); 
    155152    nsca::socket socket(io_service); 
    156153    socket.connect(nscahost_, nscaport_); 
    157154    nsca::packet packet(hostname_, payload_length_, time_delta_); 
    158155    packet.code = code; 
    159     packet.host = "hello"; 
    160     packet.result = to_string(msg) + "|" + to_string(perf); 
     156    packet.service = utf8::cvt<std::string>(command); 
     157    packet.result = utf8::cvt<std::string>(msg) + "|" + utf8::cvt<std::string>(perf); 
    161158    socket.recv_iv(password_, encryption_method_, boost::posix_time::seconds(timeout_)); 
    162159    socket.send_nsca(packet, boost::posix_time::seconds(timeout_)); 
    163160    return NSCAPI::isSuccess; 
     161  } catch (nsca::nsca_encrypt::encryption_exception &e) { 
     162    NSC_LOG_ERROR_STD(_T("Failed to encrypt data: ") + e.getMessage()); 
     163    return NSCAPI::hasFailed; 
     164     
    164165  } catch (std::exception &e) { 
    165166    NSC_LOG_ERROR_STD(_T("Failed to send data: ") + to_wstring(e.what())); 
  • modules/Scheduler/Scheduler.cpp

    rc760fc9 rb7d17f8  
    109109    _T("SCHEDULE COMMAND"), _T("Command to execute")) 
    110110 
     111    (_T("alias"), sh::wstring_key(&item.alias, def==NULL?_T(""):def->alias), 
     112    _T("SCHEDULE ALIAS"), _T("The alias (service name) to report to server")) 
     113 
    111114    (_T("report"), sh::wstring_key(&report, def==NULL?_T("all"):nscapi::report::to_string(def->report)), 
    112115    _T("REPORT MODE"), _T("What to report to the server (any of the following: all, critical, warning, unknown, ok)")) 
     
    130133  scheduler::target item = read_schedule(path + _T("/") + alias, alias, &def); 
    131134  strEx::parse_command(item.command, item.command, item.arguments); 
     135  NSC_DEBUG_MSG_STD(_T("Adding scheduled task: ") + alias); 
    132136  scheduler_.add_task(item); 
    133137} 
Note: See TracChangeset for help on using the changeset viewer.