Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds the UdpSocket class. refs #4054
- Loading branch information
Kai Goller
authored and
Michael Friedrich
committed
Feb 8, 2017
1 parent
336deea
commit 444dfc3
Showing
14 changed files
with
596 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* The LogstashWriter type writes check result metrics and | ||
* performance data to a TCP or UDP socket. | ||
*/ | ||
|
||
library "perfdata" | ||
|
||
object LogstashWriter "logstash" { | ||
//host = "127.0.0.1" | ||
//port = 9201 | ||
/* default is tcp */ | ||
//defaultProtocol = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/****************************************************************************** | ||
* Icinga 2 * | ||
* Copyright (C) 2012-2016 Icinga Development Team (https://www.icinga.org/) * | ||
* * | ||
* This program is free software; you can redistribute it and/or * | ||
* modify it under the terms of the GNU General Public License * | ||
* as published by the Free Software Foundation; either version 2 * | ||
* of the License, or (at your option) any later version. * | ||
* * | ||
* This program is distributed in the hope that it will be useful, * | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
* GNU General Public License for more details. * | ||
* * | ||
* You should have received a copy of the GNU General Public License * | ||
* along with this program; if not, write to the Free Software Foundation * | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * | ||
******************************************************************************/ | ||
|
||
#include "base/udpsocket.hpp" | ||
#include "base/logger.hpp" | ||
#include "base/utility.hpp" | ||
#include "base/exception.hpp" | ||
#include <boost/exception/errinfo_api_function.hpp> | ||
#include <boost/exception/errinfo_errno.hpp> | ||
#include <iostream> | ||
|
||
using namespace icinga; | ||
|
||
void UdpSocket::SocketType(){ | ||
socktype = SOCK_DGRAM; | ||
protocol = IPPROTO_UDP; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/****************************************************************************** | ||
* Icinga 2 * | ||
* Copyright (C) 2012-2016 Icinga Development Team (https://www.icinga.org/) * | ||
* * | ||
* This program is free software; you can redistribute it and/or * | ||
* modify it under the terms of the GNU General Public License * | ||
* as published by the Free Software Foundation; either version 2 * | ||
* of the License, or (at your option) any later version. * | ||
* * | ||
* This program is distributed in the hope that it will be useful, * | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
* GNU General Public License for more details. * | ||
* * | ||
* You should have received a copy of the GNU General Public License * | ||
* along with this program; if not, write to the Free Software Foundation * | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * | ||
******************************************************************************/ | ||
|
||
#ifndef UDPSOCKET_H | ||
#define UDPSOCKET_H | ||
|
||
#include "base/i2-base.hpp" | ||
#include "base/socket.hpp" | ||
|
||
namespace icinga | ||
{ | ||
|
||
/** | ||
* A UDP socket. | ||
* | ||
* @ingroup base | ||
*/ | ||
class I2_BASE_API UdpSocket : public Socket | ||
{ | ||
public: | ||
DECLARE_PTR_TYPEDEFS(UdpSocket); | ||
|
||
private: | ||
void SocketType(); | ||
}; | ||
} | ||
|
||
#endif /* UDPSOCKET_H */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,3 +63,4 @@ class GelfWriter : public ObjectImpl<GelfWriter> | |
} | ||
|
||
#endif /* GELFWRITER_H */ | ||
|
Oops, something went wrong.