Skip to content

Instantly share code, notes, and snippets.

@patent-ed
Created July 7, 2023 11:18
Show Gist options
  • Save patent-ed/f56b209360cbd2c7e4740fa88ab62df3 to your computer and use it in GitHub Desktop.
Save patent-ed/f56b209360cbd2c7e4740fa88ab62df3 to your computer and use it in GitHub Desktop.
Last Nessus - Tenable scan day
#!/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