mirror of
https://github.com/opinkerfi/nagios-plugins.git
synced 2026-02-13 02:20:57 +01:00
Compare commits
16 Commits
1.0.0-3
...
travis_ci_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c344fe7e8 | ||
|
|
090c4ed475 | ||
|
|
3733ab15ed | ||
|
|
a50eb30511 | ||
|
|
662532ff1f | ||
|
|
ef4b65a81b | ||
|
|
484e5c3c71 | ||
|
|
d661046464 | ||
|
|
2a2c3f7dff | ||
|
|
802a8a138e | ||
|
|
365576221a | ||
|
|
51c659990b | ||
|
|
343c42339f | ||
|
|
8f89f773e3 | ||
|
|
24518a74e7 | ||
|
|
cdc1daad6d |
47
.travis.yml
Normal file
47
.travis.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
#sudo: required
|
||||
#env:
|
||||
# matrix:
|
||||
# - OS_TYPE=centos OS_VERSION=6
|
||||
# - OS_TYPE=centos OS_VERSION=7
|
||||
#
|
||||
#services:
|
||||
# - docker
|
||||
#
|
||||
#before_install:
|
||||
# - sudo apt-get update
|
||||
# - echo 'DOCKER_OPTS="-H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock -s devicemapper"' | sudo tee /etc/default/docker > /dev/null
|
||||
# - sudo service docker restart
|
||||
# - sleep 5
|
||||
# - sudo docker pull centos:centos${OS_VERSION}
|
||||
#
|
||||
#
|
||||
#script:
|
||||
# # Run tests in Container
|
||||
# - tests/setup_tests.sh ${OS_VERSION}
|
||||
#
|
||||
sudo: required
|
||||
language: python
|
||||
|
||||
env:
|
||||
global:
|
||||
- DOCKER_IMAGE=alectolytic/rpmbuilder
|
||||
- COPR_REPOSITORY=opinkerfi/nagios-plugins
|
||||
- OS_ARCH=x86_64
|
||||
matrix:
|
||||
# - OS_TYPE=fedora OS_DIST=fedora OS_VERSION=24
|
||||
- OS_TYPE=centos OS_DIST=epel OS_VERSION=7
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
install: true
|
||||
|
||||
script:
|
||||
- docker run -v ${PWD}/check_firewall_active:/sources -v ${PWD}:/output:Z -e "SRPM_ONLY=1" ${DOCKER_IMAGE}:${OS_TYPE}-${OS_VERSION}
|
||||
# - docker run -v ${PWD}/check_firewall_active:/sources:ro -v ${PWD}:/output:rw -v ${PWD}/workspace:/workspace:rw -v ${PWD}/rpmbuild:/rpmbuild:rw -e "SRPM_ONLY=1" ${DOCKER_IMAGE}:${OS_TYPE}-${OS_VERSION}
|
||||
|
||||
after_success:
|
||||
- pip install copr-cli simplejson
|
||||
- openssl aes-256-cbc -K $encrypted_f965aefb5778_key -iv $encrypted_f965aefb5778_iv -in .copr.enc -out .copr -d
|
||||
- if [ ! -z "${TRAVIS_TAG}" ]; then copr-cli --config .copr build -r ${OS_DIST}-${OS_VERSION}-${OS_ARCH} ${COPR_REPOSITORY} *.src.rpm; fi
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
%define debug_package %{nil}
|
||||
%define release 3
|
||||
|
||||
Summary: A Nagios plugin to check if iptables are actually enforcing rules
|
||||
Name: nagios-okplugin-check_firewall_active
|
||||
Version: 1.0.0
|
||||
Release: %{release}%{?dist}
|
||||
Version: 1.0.2
|
||||
Release: 1%{?dist}
|
||||
License: GPLv2+
|
||||
Group: Applications/System
|
||||
URL: https://github.com/opinkerfi/nagios-plugins/issues
|
||||
@@ -47,6 +46,7 @@ rm -rf %{buildroot}
|
||||
restorecon -v %{_libdir}/nagios/plugins/check_firewall_active.sh /etc/nrpe.d/check_firewall_active.cfg /etc/sudoers.d/check_firewall_active
|
||||
|
||||
%changelog
|
||||
* Thu Dec 21 2016 Gardar Thorsteinsson <gardart@gmail.com> 1.0.1-1
|
||||
* Thu Dec 21 2016 Gardar Thorsteinsson <gardart@gmail.com> 1.0.0-3
|
||||
* Thu Dec 20 2016 Richard Allen <ra@ok.is> 0.1-1
|
||||
- Initial packaging
|
||||
|
||||
@@ -48,9 +48,9 @@ print_help() {
|
||||
|
||||
echo "Add this to your sudoers file by running visudo to add access:"
|
||||
if [ -r /proc/modules ]; then
|
||||
echo "Cmnd_Alias MULTIPATH=$MULTIPATH -l"
|
||||
echo "Cmnd_Alias MULTIPATH=$MULTIPATH -ll"
|
||||
else
|
||||
echo "Cmnd_Alias MULTIPATH=$MULTIPATH -l, $SUDO"
|
||||
echo "Cmnd_Alias MULTIPATH=$MULTIPATH -ll, $SUDO"
|
||||
fi
|
||||
echo "nagios ALL= NOPASSWD: MULTIPATH"
|
||||
echo "The user nagios may very well be nobody or someone else depending on your configuration"
|
||||
@@ -98,7 +98,7 @@ if [ $(id -un) != "root" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
OUTPUT=$($MULTIPATH -l 2>/dev/null)
|
||||
OUTPUT=$($MULTIPATH -ll 2>/dev/null)
|
||||
if [ $? != 0 ]; then
|
||||
# Failed. grab more info why
|
||||
if [ $(id -un) != "root" ] && [ `$SUDO -l | grep -c multipath` -eq 0 ]; then
|
||||
@@ -112,7 +112,7 @@ if [ $? != 0 ]; then
|
||||
exit $STATE_UNKNOWN
|
||||
fi
|
||||
|
||||
echo "MULTIPATH: $(MULTIPATH -l 2>&1)"
|
||||
echo "MULTIPATH: $($MULTIPATH -ll 2>&1)"
|
||||
exit $STATE_UNKNOWN
|
||||
fi
|
||||
|
||||
@@ -137,6 +137,7 @@ if [ "$NUMPATHS" ]; then
|
||||
/^ \\/ {targets++; next} # count targets (lenny)
|
||||
/[0-9]+:[0-9]+:[0-9]+:[0-9]+/ {
|
||||
if (/active undef running/) { targets++ } # count targets (squeeze)
|
||||
if (/active ready running/) { targets++ } # count targets (RHEL6)
|
||||
next
|
||||
}
|
||||
{
|
||||
|
||||
0
output/.gitkeep
Normal file
0
output/.gitkeep
Normal file
0
rpmbuild/.gitkeep
Normal file
0
rpmbuild/.gitkeep
Normal file
24
tests/setup_tests.sh
Executable file
24
tests/setup_tests.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh -xe
|
||||
|
||||
# This script starts docker and systemd (if el7)
|
||||
|
||||
# Version of CentOS/RHEL
|
||||
el_version=$1
|
||||
|
||||
# Run tests in Container
|
||||
if [ "$el_version" = "6" ]; then
|
||||
|
||||
sudo docker run --rm=true -v `pwd`:/nagios-plugins:rw centos:centos${OS_VERSION} /bin/bash -c "bash -xe /nagios-plugins/tests/test_inside_docker.sh ${OS_VERSION}"
|
||||
|
||||
elif [ "$el_version" = "7" ]; then
|
||||
|
||||
docker run --privileged -d -ti -e "container=docker" -v /sys/fs/cgroup:/sys/fs/cgroup -v `pwd`:/nagios-plugins:rw centos:centos${OS_VERSION} /usr/sbin/init
|
||||
DOCKER_CONTAINER_ID=$(docker ps | grep centos | awk '{print $1}')
|
||||
docker logs $DOCKER_CONTAINER_ID
|
||||
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec "bash -xe /nagios-plugins/tests/test_inside_docker.sh ${OS_VERSION};
|
||||
echo -ne \"------\nEND NAGIOS-PLUGINS TESTS\n\";"
|
||||
docker ps -a
|
||||
docker stop $DOCKER_CONTAINER_ID
|
||||
docker rm -v $DOCKER_CONTAINER_ID
|
||||
|
||||
fi
|
||||
2
tests/test_inside_docker.sh
Executable file
2
tests/test_inside_docker.sh
Executable file
@@ -0,0 +1,2 @@
|
||||
echo "Keyrsla fyrir CentOS $1"
|
||||
ls -l /
|
||||
0
workspace/.gitkeep
Normal file
0
workspace/.gitkeep
Normal file
Reference in New Issue
Block a user