Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save patent-ed/3064b0b35e8aebb7022b4fd1a2928fb2 to your computer and use it in GitHub Desktop.
Save patent-ed/3064b0b35e8aebb7022b4fd1a2928fb2 to your computer and use it in GitHub Desktop.
Last Nessus - Tenable scan report date
#!/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