Created
July 7, 2023 11:18
-
-
Save patent-ed/f56b209360cbd2c7e4740fa88ab62df3 to your computer and use it in GitHub Desktop.
Last Nessus - Tenable scan day
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 | |
# This will convert from epoch time | |
lastScanned=$(/Library/NessusAgent/run/sbin/nessuscli agent status | grep -m 1 "scanned:" | awk '{ print $0}' | sed 's/Last scanned: //') | |
lastScannedDate=$(date -j -r $lastScanned) | |
if [[ $lastScanned == "" ]]; then | |
echo "<result>UNKNOWN</result>" | |
else | |
echo "<result>$lastScannedDate</result>" | |
fi | |
echo "<result>$lastScan</result>" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment