Changeset 74a8115 in nscp
- Timestamp:
- 02/22/08 07:43:40 (5 years ago)
- Children:
- 274362b
- Parents:
- 83d61f0
- Location:
- trunk
- Files:
-
- 4 edited
-
changelog (modified) (1 diff)
-
modules/NRPEListener/NRPEListener.cpp (modified) (4 diffs)
-
modules/NSCAAgent/NSCAThread.cpp (modified) (1 diff)
-
modules/NSCAAgent/NSCAThread.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/changelog
r83d61f0 r74a8115 7 7 * Improved socket performance (would be nice if we could be used as a "hub") 8 8 9 2008-02-19 MickeM 9 2008-02-22 MickeM 10 * Fixed issues in the NRPE module (now returns the correct status) 11 + Added a lot of "error log" for when the packet size in NRPEListener is not correct 12 (might make it simpler to diagnose problems) 13 14 2008-02-20 MickeM 10 15 + Added new module NRPEClient that can act as a NRPE client, might be useful for testing things and 11 16 eventually for relaying events. -
trunk/modules/NRPEListener/NRPEListener.cpp
r087a3c9 r74a8115 81 81 scriptDirectory_ = NSCModuleHelper::getSettingsString(NRPE_SECTION_TITLE, NRPE_SETTINGS_SCRIPTDIR ,NRPE_SETTINGS_SCRIPTDIR_DEFAULT); 82 82 buffer_length_ = NSCModuleHelper::getSettingsInt(NRPE_SECTION_TITLE, NRPE_SETTINGS_STRLEN, NRPE_SETTINGS_STRLEN_DEFAULT); 83 if (buffer_length_ != 1024) 84 NSC_DEBUG_MSG_STD(_T("Non-standard buffer length (hope you have recompiled check_nrpe changing #define MAX_PACKETBUFFER_LENGTH = ") + strEx::itos(buffer_length_)); 83 85 std::list<std::wstring> commands = NSCModuleHelper::getSettingsSection(NRPE_HANDLER_SECTION_TITLE); 84 86 std::list<std::wstring>::const_iterator it; … … 276 278 break; 277 279 if (!lastReadHasMore) { 280 NSC_LOG_MESSAGE(_T("Could not read a full NRPE packet from socket, only got: ") + strEx::itos(block.getLength())); 278 281 client->close(); 279 282 return; … … 282 285 } 283 286 if (i >= maxWait) { 284 NSC_LOG_ERROR_STD(_T("Timeout reading NRPE-packet (increase socket_timeout) "));287 NSC_LOG_ERROR_STD(_T("Timeout reading NRPE-packet (increase socket_timeout), we only got: ") + strEx::itos(block.getLength())); 285 288 client->close(); 286 289 return; … … 317 320 return; 318 321 } 322 } else { 323 NSC_LOG_ERROR_STD(_T("We got more then we wanted ") + strEx::itos(NRPEPacket::getBufferLength(buffer_length_)) + _T(", we only got: ") + strEx::itos(block.getLength())); 324 client->close(); 325 return; 319 326 } 320 327 } catch (simpleSocket::SocketException e) { -
trunk/modules/NSCAAgent/NSCAThread.cpp
r34f5502 r74a8115 74 74 } 75 75 } 76 //NSC_DEBUG_MSG_STD(_T("Result: ") + result.toString());77 76 return result; 78 77 } -
trunk/modules/NSCAAgent/NSCAThread.h
re0936e3 r74a8115 170 170 data->packet_version=static_cast<NSCAPacket::int16_t>(htons(NSCA_PACKET_VERSION_3)); 171 171 data->timestamp=static_cast<NSCAPacket::u_int32_t>(htonl(time)); 172 data->return_code = code;172 data->return_code = ntohs(code); 173 173 data->crc32_value=static_cast<NSCAPacket::u_int32_t>(0L); 174 174
Note: See TracChangeset
for help on using the changeset viewer.








