-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93afcbf
commit ae0216c
Showing
16 changed files
with
517 additions
and
9 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
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,137 @@ | ||
## | ||
## Copyright 2024 Centreon | ||
## | ||
## This file is part of Centreon Agent. | ||
## | ||
## Licensed under the Apache License, Version 2.0 (the "License"); | ||
## you may not use this file except in compliance with the License. | ||
## You may obtain a copy of the License at | ||
## | ||
## http://www.apache.org/licenses/LICENSE-2.0 | ||
## | ||
## Unless required by applicable law or agreed to in writing, software | ||
## distributed under the License is distributed on an "AS IS" BASIS, | ||
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
## See the License for the specific language governing permissions and | ||
## limitations under the License. | ||
## | ||
## For more information : [email protected] | ||
## | ||
|
||
# file: centagent.cfg | ||
# brief: Sample main config file for Centreon Agent @VERSION@ | ||
# | ||
# Read the documentation for more information on this configuration file. I've | ||
# provided some comments here, but things may not be so clear without further | ||
# explanation. | ||
# If you want to have a list of all options, | ||
# in a terminal, executes @CMAKE_INSTALL_FULL_BINDIR@/@CENTREON_AGENT@ --help | ||
|
||
|
||
# var: log_file | ||
# brief: This is the main log file where service and host events are logged for | ||
# historical purposes. This should be the first option specified in the | ||
# config file! | ||
|
||
log_file=@AGENT_VAR_LOG_DIR@/@[email protected] | ||
|
||
|
||
# var: log_level | ||
# brief: You can choose log verbosity: | ||
# critical, error, info, debug, trace | ||
# You can change log verbosity during runtime with USR1 and USR2 signals | ||
# Ex: kill -USR1 <pid> to increase verbosity (error => info for example) | ||
# kill -USR2 <pid> to decrease verbosity | ||
|
||
log_level=info | ||
|
||
|
||
# var: logger-type | ||
# brief: type of log output: stdout or to a file | ||
|
||
logger-type=file | ||
|
||
|
||
# var: logger-file | ||
# brief: in case of logger-type=file, logs will be written in this file | ||
|
||
logger-file=/var/log/centreon-agent/centagent.log | ||
|
||
|
||
# var: logger-max-file-size | ||
# brief: max log file size in bytes until rotate | ||
|
||
logger-max-file-size=10000000 | ||
|
||
|
||
# var: logger-max-files | ||
# brief: max number of log files (oldest will be removed) | ||
|
||
logger-max-files=3 | ||
|
||
|
||
# var: endpoint | ||
# brief: This parameter is mandatory | ||
# In normal case (agent connects to engine), this endpoint is the | ||
# opentelemetry listening endpoint of engine | ||
# His syntax is <ip or dns name>:port | ||
|
||
#endpoint=<poller ip>:4317 | ||
|
||
|
||
# var: encryption | ||
# brief: false by default | ||
# set to true to enable encryption between engine and agent | ||
|
||
encryption=false | ||
|
||
|
||
# var: certificate | ||
# brief: path of the certificate file used by encryption | ||
|
||
#certificate=/etc/centron-agent/certif.crt | ||
|
||
|
||
# var: private_key | ||
# brief: path of the key file of the certificate file | ||
|
||
#private_key=/etc/centreon-agent/certif.key | ||
|
||
|
||
# var: ca_certificate | ||
# brief: path of the authority certificate file used by encryption | ||
|
||
#ca_certificate=/etc/centreon-agent/ca.crt | ||
|
||
|
||
# var: ca_name | ||
# brief: name of the host declared in authority certificate | ||
|
||
#ca_name= | ||
|
||
|
||
# var: host | ||
# brief: name of the host declared in centreon configuration | ||
# if not given, hostname of the computer will be used | ||
|
||
#host= | ||
|
||
|
||
# var: reversed-grpc-streaming | ||
# brief: used when centreon agent is not allowed to connect to poller | ||
# if this option if set to true, centreon agent become a | ||
# grpc server listening on pair interface:port given by | ||
# endpoint parameter where poller will have to connect to | ||
|
||
reversed-grpc-streaming=false | ||
|
||
|
||
# var: host | ||
# brief: name of the host declared in centreon configuration | ||
# if not given, hostname of the computer will be used | ||
|
||
#host= | ||
|
||
|
||
|
||
|
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,27 @@ | ||
# | ||
# Copyright 2016 Centreon | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# For more information : [email protected] | ||
# | ||
|
||
[Unit] | ||
Description=Centreon Agent | ||
|
||
[Service] | ||
ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/@CENTREON_AGENT@ @PREFIX_AGENT_CONF@/@[email protected] | ||
ExecReload=/bin/kill -HUP $MAINPID | ||
Type=simple | ||
User=centreon-agent | ||
|
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,40 @@ | ||
name: "centreon-agent-selinux" | ||
arch: "${ARCH}" | ||
platform: "linux" | ||
version_schema: "none" | ||
version: "${VERSION}" | ||
release: "${RELEASE}${DIST}" | ||
section: "default" | ||
priority: "optional" | ||
maintainer: "Centreon <[email protected]>" | ||
description: | | ||
SELinux context for centreon-agent | ||
vendor: "Centreon" | ||
homepage: "https://centreon.com" | ||
license: "Apache-2.0" | ||
|
||
depends: | ||
- policycoreutils | ||
- centreon-common-selinux | ||
replaces: | ||
- centreon-agent-selinux-debuginfo | ||
conflicts: | ||
- centreon-agent-selinux-debuginfo | ||
provides: | ||
- centreon-agent-selinux-debuginfo | ||
|
||
contents: | ||
- src: "../selinux/centreon-agent/centreon-agent.pp" | ||
dst: "/usr/share/selinux/packages/centreon/centreon-agent.pp" | ||
file_info: | ||
mode: 0655 | ||
|
||
scripts: | ||
postinstall: ./scripts/centreon-agent-selinux-postinstall.sh | ||
preremove: ./scripts/centreon-agent-selinux-preremove.sh | ||
|
||
rpm: | ||
summary: SELinux context for centreon-agent | ||
signature: | ||
key_file: ${RPM_SIGNING_KEY_FILE} | ||
key_id: ${RPM_SIGNING_KEY_ID} |
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,25 @@ | ||
#!/bin/sh | ||
|
||
startCentagent() { | ||
systemctl daemon-reload ||: | ||
systemctl unmask centagent.service ||: | ||
systemctl preset centagent.service ||: | ||
systemctl enable centagent.service ||: | ||
systemctl restart centagent.service ||: | ||
} | ||
|
||
# on debian, it is needed to recreate centreon-agent user at each upgrade because it is removed on postrm step on versions < 23.10 | ||
if [ "$1" = "configure" ] ; then | ||
if [ ! "$(getent passwd centreon-agent)" ]; then | ||
adduser --system --group --shell /bin/bash --no-create-home centreon-agent | ||
fi | ||
if [ "$(getent passwd nagios)" ]; then | ||
usermod -a -G centreon-agent nagios | ||
fi | ||
chown -R centreon-agent:centreon-agent \ | ||
/etc/centreon-agent \ | ||
/var/log/centreon-agent | ||
fi | ||
|
||
startCentagent | ||
|
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,8 @@ | ||
#!/bin/sh | ||
|
||
case "$1" in | ||
purge) | ||
deluser centreon-agent || : | ||
delgroup centreon-agent || : | ||
;; | ||
esac |
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,10 @@ | ||
#!/bin/sh | ||
|
||
if ! id centreon-agent > /dev/null 2>&1; then | ||
useradd -r centreon-agent > /dev/null 2>&1 | ||
fi | ||
|
||
if id -g nagios > /dev/null 2>&1; then | ||
usermod -a -G centreon-agent nagios | ||
fi | ||
|
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,3 @@ | ||
#!/bin/sh | ||
|
||
systemctl stop centagent.service ||: |
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,25 @@ | ||
#!/bin/sh | ||
|
||
install() { | ||
semodule -i /usr/share/selinux/packages/centreon/centreon-engine.pp > /dev/null 2>&1 || : | ||
} | ||
|
||
upgrade() { | ||
semodule -i /usr/share/selinux/packages/centreon/centreon-engine.pp > /dev/null 2>&1 || : | ||
} | ||
|
||
action="$1" | ||
if [ "$1" = "configure" ] && [ -z "$2" ]; then | ||
action="install" | ||
elif [ "$1" = "configure" ] && [ -n "$2" ]; then | ||
action="upgrade" | ||
fi | ||
|
||
case "$action" in | ||
"1" | "install") | ||
install | ||
;; | ||
"2" | "upgrade") | ||
upgrade | ||
;; | ||
esac |
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,5 @@ | ||
#!/bin/sh | ||
|
||
if [ "$1" -lt "1" ]; then # Final removal | ||
semodule -r centreon-agent > /dev/null 2>&1 || : | ||
fi |
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 @@ | ||
/usr/bin/centagent -- gen_context(system_u:object_r:centreon_agent_exec_t,s0) |
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 @@ | ||
## <summary>Centreon Agent monitoring agent.</summary> |
Oops, something went wrong.