A Bash Script – Jamf Extension Attribute that reports the Last Nessus – Tenable scan report date Jamf Extension Attribute
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 |
A Bash Script – Jamf Extension Attribute that reports the Last Nessus – Tenable scan report day Jamf Extension Attribute
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 |