diff --git a/.github/workflows/ubuntu-latest.yaml b/.github/workflows/ubuntu-latest.yaml index 58ee5fb..230abc0 100644 --- a/.github/workflows/ubuntu-latest.yaml +++ b/.github/workflows/ubuntu-latest.yaml @@ -12,13 +12,10 @@ jobs: - uses: actions/checkout@v1 - name: Install dependencies run: | - sudo apt-get install -yy libmonitoring-plugin-perl monitoring-plugins-common - - name: Move Plugin to nagios-plugins dir - run: | - sudo mv check_ro_mounts.pl /usr/lib/nagios/plugins/ + sudo apt-get install -yy perl - name: Launch plugin with --help run: | - /usr/lib/nagios/plugins/check_ro_mounts.pl --help + ./check_ro_mounts.pl --help launch-checks: needs: launch-help runs-on: ubuntu-latest @@ -26,25 +23,22 @@ jobs: - uses: actions/checkout@v1 - name: Install dependencies run: | - sudo apt-get install -yy libmonitoring-plugin-perl monitoring-plugins-common - - name: Move Plugin to nagios-plugins dir - run: | - sudo mv check_ro_mounts.pl /usr/lib/nagios/plugins/ + sudo apt-get install -yy perl - name: Execute in debug mode (should detect read-only mounts) run: | - /usr/lib/nagios/plugins/check_ro_mounts.pl -d + ./check_ro_mounts.pl -d continue-on-error: true - name: Execute with specific file system ext4 (should not detect any read-only mounts) run: | - /usr/lib/nagios/plugins/check_ro_mounts.pl -T ext4 + ./check_ro_mounts.pl -T ext4 - name: Execute with excluded file systems and mount paths (should not detect any read-only mounts) run: | - /usr/lib/nagios/plugins/check_ro_mounts.pl -X securityfs -X pstore -X autofs -X bpf -X mqueue -X debugfs -X tracefs -X fusectl -X configfs -X ramfs -X squashfs -X tmpfs -X proc -X devpts -X sysfs -X cgroup -X cgroup2 + ./check_ro_mounts.pl -X securityfs -X pstore -X autofs -X bpf -X mqueue -X debugfs -X tracefs -X fusectl -X configfs -X ramfs -X squashfs -X tmpfs -X proc -X devpts -X sysfs -X cgroup -X cgroup2 - name: Execute with file systems in missing fstab file (should alert for missing /etc/fstab) run: | - /usr/lib/nagios/plugins/check_ro_mounts.pl -F -f ./fstab + ./check_ro_mounts.pl -F -f ./fstab continue-on-error: true - name: Execute with file systems in fstab file (should not detect any read-only mounts) run: | for mount in $(egrep "(ext3|ext4|xfs) rw" /proc/mounts); do sudo echo "$mount" >> ./fstab; done - /usr/lib/nagios/plugins/check_ro_mounts.pl -F -f ./fstab + ./check_ro_mounts.pl -F -f ./fstab