Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[procedure] How to install shinken on Rocky/centos/redhat > 7 + gift for saltstack integration ❤️ #2033

Open
garadar opened this issue Apr 5, 2024 · 1 comment

Comments

@garadar
Copy link

garadar commented Apr 5, 2024

Introduction

Shinken doesn't support Python3 yet, making it a bit tricky to install on newer operating systems like Rocky 8. However, I've put together a step-by-step guide for installation that I've personally tested and confirmed to work.

I have integrated all this procedure on salt repository available here (with thruk integration):
https://github.com/garadar/shinken_salt

My architecture:

Arbiter and thruk on dedicated VM Rocky8 for monitoring. No other service on it
Poller/broker on a server with other thing runnint on it

Procedure

Create user and group :

useradd shinken
useradd nagios
groupadd shinken
groupadd nagios

Install rpm dependencies for shinken:

dnf install python2 python2-pip python2-devel gcc libcurl-devel openssl-devel

Shinken does not work because of Python's standard, which requires you to specify a version (Python2 or Python3, making this an annoying choice! But we don't want to deal with that here). So, we need to set Python alternative:

alternatives --set python /usr/bin/python2

You should have something like that:

alternatives  --list |grep python
python              	manual	/usr/bin/python2
python3             	auto  	/usr/bin/python3.6

Install PycURL with a Specific Version Required by Shinken:

PYCURL_SSL_LIBRARY=openssl pip2 install pycurl==7.43.0.4 --compile --no-cache-dir

Install shinken with pip:

pip2 install shinken

Initialize Shinken and Install All Modules:

shinken --init
shinken install pickle-retention-file-scheduler livestatus named-pipe logstore-sqlite

Reload systemd to Create Generic Service:

systemctl daemon-reload

You should see a new service created by systemd-sysv-generator:

systemctl cat shinken-broker.service 
# /run/systemd/generator.late/shinken-broker.service
# Automatically generated by systemd-sysv-generator

[Unit]
Documentation=man:systemd-sysv-generator(8)
SourcePath=/etc/rc.d/init.d/shinken-broker
Description=LSB: Shinken broker daemon
Before=multi-user.target
Before=multi-user.target
Before=multi-user.target
Before=graphical.target
After=all.target

[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
SuccessExitStatus=5 6
ExecStart=/etc/rc.d/init.d/shinken-broker start
ExecStop=/etc/rc.d/init.d/shinken-broker stop
ExecReload=/etc/rc.d/init.d/shinken-broker reload

Now it should be workind without errors (working for me). You need to include your config file to make it work.

@garadar garadar changed the title [procedure] How to install shinken on Rocky/centos/redhat > 7salt-c [procedure] How to install shinken on Rocky/centos/redhat > 7 + gift for saltstack integration ❤️ Apr 5, 2024
@garadar
Copy link
Author

garadar commented Sep 2, 2024

Hi everyone,

It's working also on rocky8 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant