- Timestamp:
- 04/11/11 06:33:49 (2 years ago)
- Branches:
- master, 0.4.0, 0.4.1, 0.4.2
- Children:
- d66ccee
- Parents:
- c391984
- Location:
- modules
- Files:
-
- 3 edited
-
CheckDisk/filter.cpp (modified) (2 diffs)
-
NSCAAgent/NSCAAgent.cpp (modified) (1 diff)
-
Scheduler/Scheduler.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
modules/CheckDisk/filter.cpp
r1f24a1c rb7d17f8 35 35 (_T("accessed"), (type_date)) 36 36 (_T("written"), (type_date)) 37 (_T(" generated"), (type_date));37 (_T("created"), (type_date)); 38 38 } 39 39 … … 77 77 else if (key == _T("line_count")) 78 78 ret = &object_type::get_line_count; 79 else if (key == _T("access "))79 else if (key == _T("accessed")) 80 80 ret = &object_type::get_access; 81 else if (key == _T("creat ion"))81 else if (key == _T("created")) 82 82 ret = &object_type::get_creation; 83 83 else if (key == _T("written")) -
modules/NSCAAgent/NSCAAgent.cpp
rc760fc9 rb7d17f8 149 149 NSCAPI::nagiosReturn NSCAAgent::handleSimpleNotification(const std::wstring channel, const std::wstring command, NSCAPI::nagiosReturn code, std::wstring msg, std::wstring perf) { 150 150 try { 151 NSC_DEBUG_MSG_STD(_T("* * *NSCA * * * Handling command: ") + command);152 151 boost::asio::io_service io_service; 153 NSC_DEBUG_MSG_STD(_T("* * *NSCA * * * message: ") + msg);154 NSC_DEBUG_MSG_STD(_T("* * *NSCA * * * performance: ") + perf);155 152 nsca::socket socket(io_service); 156 153 socket.connect(nscahost_, nscaport_); 157 154 nsca::packet packet(hostname_, payload_length_, time_delta_); 158 155 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); 161 158 socket.recv_iv(password_, encryption_method_, boost::posix_time::seconds(timeout_)); 162 159 socket.send_nsca(packet, boost::posix_time::seconds(timeout_)); 163 160 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 164 165 } catch (std::exception &e) { 165 166 NSC_LOG_ERROR_STD(_T("Failed to send data: ") + to_wstring(e.what())); -
modules/Scheduler/Scheduler.cpp
rc760fc9 rb7d17f8 109 109 _T("SCHEDULE COMMAND"), _T("Command to execute")) 110 110 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 111 114 (_T("report"), sh::wstring_key(&report, def==NULL?_T("all"):nscapi::report::to_string(def->report)), 112 115 _T("REPORT MODE"), _T("What to report to the server (any of the following: all, critical, warning, unknown, ok)")) … … 130 133 scheduler::target item = read_schedule(path + _T("/") + alias, alias, &def); 131 134 strEx::parse_command(item.command, item.command, item.arguments); 135 NSC_DEBUG_MSG_STD(_T("Adding scheduled task: ") + alias); 132 136 scheduler_.add_task(item); 133 137 }
Note: See TracChangeset
for help on using the changeset viewer.








