Created
July 7, 2023 11:04
-
-
Save patent-ed/3064b0b35e8aebb7022b4fd1a2928fb2 to your computer and use it in GitHub Desktop.
Last Nessus - Tenable scan report date
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
#!/bin/bash | |
lastScan=$(/Library/NessusAgent/run/sbin/nessuscli agent status | grep -m 1 "set:" | awk '{ print $0}' | sed 's/Plugin set: //') | |
lastScanDate=$(date -r $lastScan) | |
if [[ $lastScan == "" ]]; then | |
echo "<result>UNKNOWN Last Nessus Tenable scan report date</result>" | |
else | |
echo "<result>$lastScan - $lastScanDate</result>" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment