forked from naemon/naemon-core
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
193 changed files
with
8,861 additions
and
6,154 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,37 @@ | ||
name: citest | ||
|
||
on: | ||
push: | ||
pull_request: | ||
release: | ||
|
||
jobs: | ||
citest: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
#- name: Setup tmate session, see https://github.com/marketplace/actions/debugging-with-tmate | ||
# uses: mxschmitt/action-tmate@v3 | ||
- name: prepare machine | ||
run: | | ||
sudo apt-get install \ | ||
autoconf \ | ||
build-essential \ | ||
gperf \ | ||
check \ | ||
help2man \ | ||
python3-pip | ||
sudo pip3 install --upgrade 'pip<21.0' | ||
sudo pip3 --disable-pip-version-check install behave flake8 | ||
- name: run build | ||
run: | | ||
./autogen.sh | ||
make | ||
- name: run tests | ||
run: | | ||
make check VERBOSE=1 | ||
make distcheck | ||
flake8 features/ | ||
behave |
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,6 @@ | ||
workflow: | ||
steps: | ||
- branch_package: | ||
source_project: home:naemon:daily | ||
source_package: naemon-core | ||
target_project: home:naemon:test |
This file was deleted.
Oops, something went wrong.
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,85 @@ | ||
# Naemon development environment | ||
|
||
Contributing to an open source project can be a challenging task, | ||
even without figuring out how to launch the corresponding software | ||
inside an IDE. | ||
We are more than happy to see that you are interested in | ||
contributing to the Naemon Core project. | ||
|
||
To help you getting started, we provide predefined configurations | ||
for [Visual Studio Code](https://code.visualstudio.com/) which will | ||
attach a debugger and has predefined tasks to run the tests. | ||
|
||
Basically this is everything you need to start coding. | ||
|
||
Due to Naemon is program for Linux, a Linux system is required for development. | ||
The shown configuration is tested on Ubuntu 22.04 and Fedora 37. | ||
This documentation will most likely also work flowlesly on new or | ||
older versions of Ubuntu and Fedora. | ||
|
||
In addition it is possible to develop on a Windows system using WSL2 ([Windows Subsystem for Linux](https://learn.microsoft.com/en-us/windows/wsl/install)) | ||
|
||
|
||
## Reqirements | ||
- [Visual Studio Code](https://code.visualstudio.com/) | ||
- [C/C++ Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) | ||
|
||
|
||
## Install build dependencies | ||
Naemon itself depends on several libraries. Everything needed can be easily | ||
installed via the package manager of your distribution. | ||
|
||
### Fedora | ||
``` | ||
sudo dnf group install "Development Tools" | ||
sudo dnf install git glib2-devel help2man gperf gcc gcc-c++ gdb cmake3 pkgconfig automake autoconf nagios-plugins-all libtool perl-Test-Simple | ||
sudo ln -s /usr/lib64/nagios /usr/lib/nagios | ||
``` | ||
|
||
### Ubuntu | ||
``` | ||
sudo apt-get install git build-essential automake gperf gcc g++ gdb cmake help2man libtool libglib2.0-dev pkg-config libtest-simple-perl monitoring-plugins | ||
``` | ||
|
||
## Setup VS Code | ||
1. Clone this repository and open the folder with Visual Studio Code | ||
|
||
2. Naemon requires a configuration file to launch. | ||
Luckily there is a pre-configured task that will do all that for you. | ||
From the menu select `Terminal > Run Task... > initial` | ||
Normally you only need to run this task once. | ||
|
||
3. You are ready to rock! Make your code changes, create breakpoints and so on. | ||
To run Naemon with an debugger attached, select `Run and Debug > Start Debugging` | ||
![VSCode with running Debugger](/.vscode/vscode_debugger.png) | ||
|
||
4. Before you push your code changes, please make sure that all the tests are still green. | ||
Again there is a predefined task you can execute via | ||
`Terminal > Run Task... > Run Tests` | ||
If all tests passed, feel free to push you code and to create a pull request. | ||
|
||
## Naemon configuration files | ||
Just in case you want to provide your own `naemon.cfg` or any other configuration file | ||
just copy the files to `build/etc/naemon/` | ||
|
||
## Known issues | ||
If you get an error message like `Configured debug type 'cppdbg' is not supported` please make | ||
sure you have the [C/C++ Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) for | ||
VS Code installed and enabled. | ||
|
||
## Windows Subsystem for Linux | ||
If you prefer to use Windows as platform, please make sure to install a Ubuntu or Fedora WSL2 instance. | ||
The steps are the exactly the same as described above. We recommend to use the [Windows Terminal](https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701?hl=de-de&gl=de) | ||
to get access to the Linux shell. | ||
|
||
Make sure you have Visual Studio Code installed on your Windows System. To launch VS Code with the files | ||
from the Naemon project, simply run the `code` command. | ||
|
||
Run these commands on your WSL linux instance: | ||
``` | ||
git clone https://github.com/naemon/naemon-core.git | ||
cd naemon-core/ | ||
code . | ||
``` | ||
![Using WSL2](/.vscode/vscode_wsl.png) |
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,23 @@ | ||
{ | ||
"configurations": [ | ||
{ | ||
"name": "Linux", | ||
"includePath": [ | ||
"${workspaceFolder}/**", | ||
//"/usr/lib/gcc/x86_64-linux-gnu/11/include/**", // Debian / Ubuntu | ||
//"/usr/include/x86_64-linux-gnu/**", // Debian / Ubuntu | ||
//"/usr/lib/gcc/x86_64-redhat-linux/12/include/**", // Fedora | ||
"/usr/local/include/**", | ||
"/usr/include/**", | ||
"/usr/lib64/**", | ||
"/usr/lib/**" | ||
], | ||
"defines": [], | ||
"compilerPath": "/usr/bin/gcc", | ||
"cStandard": "gnu17", | ||
"cppStandard": "gnu++17", | ||
"intelliSenseMode": "linux-gcc-x64" | ||
} | ||
], | ||
"version": 4 | ||
} |
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,38 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Launch in dgb", | ||
"type": "cppdbg", | ||
"request": "launch", | ||
|
||
// This will trigger the "make all" task from tasks.json | ||
"preLaunchTask": "make all", | ||
// We are not using the binary from the build folder because we do not want to run the "make install" task. | ||
// The "make install" task is only to generate the default naemon configurtion files | ||
"program": "${workspaceFolder}/src/naemon/.libs/naemon", | ||
"args": [ | ||
//"--help", | ||
"${workspaceFolder}/build/etc/naemon/naemon.cfg" | ||
], | ||
"cwd": "${workspaceFolder}", | ||
"environment": [ | ||
{ | ||
"name": "LD_LIBRARY_PATH", | ||
"value": "${workspaceFolder}/.libs" | ||
} | ||
], | ||
|
||
// Optional parameter. If true, the debugger should stop at the entrypoint of the target. | ||
"stopAtEntry": true, | ||
|
||
|
||
"launchCompleteCommand": "exec-run", | ||
"MIMode": "gdb", | ||
"miDebuggerPath": "/usr/bin/gdb", | ||
} | ||
] | ||
} |
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,83 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "autogen", | ||
"type": "shell", | ||
"command": "${cwd}/autogen.sh --prefix=${cwd}/build --with-naemon-user=$(whoami) --with-naemon-group=users --with-pluginsdir=/usr/lib/nagios/plugins", | ||
"problemMatcher": [], | ||
"group": { | ||
"kind":"build", | ||
"isDefault": false | ||
} | ||
}, | ||
{ | ||
"label": "make all", | ||
"type": "shell", | ||
"command": "make -j all", | ||
"problemMatcher": [], | ||
"group": { | ||
"kind": "build", | ||
"isDefault": false | ||
} | ||
}, | ||
{ | ||
// Will create all required directories | ||
"label": "mkdir", | ||
"type": "shell", | ||
"command": "mkdir -p ${cwd}/build/var/cache/naemon ${cwd}/build/var/spool/checkresults ${cwd}/build/etc/naemon/module-conf.d", | ||
"problemMatcher": [], | ||
"group": { | ||
"kind": "build", | ||
"isDefault": false | ||
} | ||
}, | ||
{ | ||
// This will install the required default configuration files | ||
"label": "make install", | ||
"type": "shell", | ||
"command": "make install", | ||
"problemMatcher": [], | ||
"group": { | ||
"kind": "build", | ||
"isDefault": false | ||
} | ||
}, | ||
{ | ||
// Initial - Run this task, if you cloed the naemon source code from GitHub and want to start developing | ||
// You only need to execute this task once | ||
"label": "initial", | ||
"type": "shell", | ||
"command": "make install", | ||
"problemMatcher": [], | ||
"group": { | ||
"kind": "build", | ||
"isDefault": false | ||
}, | ||
"dependsOrder": "sequence", | ||
"dependsOn":[ | ||
"autogen", | ||
"make all", | ||
"make install", | ||
"mkdir" | ||
] | ||
}, | ||
{ | ||
// Run the Naemon test cases | ||
"label": "Run Tests", | ||
"type": "shell", | ||
"command": "make test", | ||
"problemMatcher": [], | ||
"group": { | ||
"kind": "build", | ||
"isDefault": false | ||
}, | ||
"dependsOrder": "sequence", | ||
"dependsOn":[ | ||
"autogen" | ||
] | ||
} | ||
] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.