Class: Nexpose::ScanStatistics
- Inherits:
-
Object
- Object
- Nexpose::ScanStatistics
- Defined in:
- lib/nexpose/scan.rb
Overview
TODO
Description
Object that represents the overview statistics for a particular scan.
Examples
# Create a new Nexpose Connection on the default port and Login
nsc = Connection.new("10.1.40.10","nxadmin","password")
nsc.login()
# Get a Site (Site ID = 12) from the NSC
site = new Site(nsc,12)
# Start a Scan of this site and pause for 1 minute
scan1 = site.scanSite()
sleep(60)
# Get the Scan Statistics for this scan
scanStatistics = new ScanStatistics(nsc,scan1["scan_id"])
# Print out number of confirmed vulnerabilities with a 10 severity
puts scanStatistics.scansummary.vuln_exploit[10]
# Print out the number of pending tasks left in the scan
puts scanStatistics.scan_summary.tasks_pending
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
The NSC Connection associated with this object.
-
#error ⇒ Object
readonly
true if an error condition exists; false otherwise.
-
#error_msg ⇒ Object
readonly
Error message string.
-
#request_xml ⇒ Object
readonly
The last XML request sent by this object.
-
#reseponse_xml ⇒ Object
readonly
The last XML response received by this object.
-
#scan_id ⇒ Object
readonly
The Scan ID.
-
#scan_summary ⇒ Object
readonly
The ScanSummary of the scan.
-
#vuln_other ⇒ Object
readonly
Vulnerability checks other.
Instance Method Summary collapse
-
#initialize(connection, scan_id) ⇒ ScanStatistics
constructor
A new instance of ScanStatistics.
Constructor Details
#initialize(connection, scan_id) ⇒ ScanStatistics
Returns a new instance of ScanStatistics.
219 220 221 222 223 |
# File 'lib/nexpose/scan.rb', line 219 def initialize(connection, scan_id) @error = false @connection = connection @scan_id = scan_id end |
Instance Attribute Details
#connection ⇒ Object (readonly)
The NSC Connection associated with this object
214 215 216 |
# File 'lib/nexpose/scan.rb', line 214 def connection @connection end |
#error ⇒ Object (readonly)
true if an error condition exists; false otherwise
202 203 204 |
# File 'lib/nexpose/scan.rb', line 202 def error @error end |
#error_msg ⇒ Object (readonly)
Error message string
204 205 206 |
# File 'lib/nexpose/scan.rb', line 204 def error_msg @error_msg end |
#request_xml ⇒ Object (readonly)
The last XML request sent by this object
206 207 208 |
# File 'lib/nexpose/scan.rb', line 206 def request_xml @request_xml end |
#reseponse_xml ⇒ Object (readonly)
The last XML response received by this object
208 209 210 |
# File 'lib/nexpose/scan.rb', line 208 def reseponse_xml @reseponse_xml end |
#scan_id ⇒ Object (readonly)
The Scan ID
210 211 212 |
# File 'lib/nexpose/scan.rb', line 210 def scan_id @scan_id end |
#scan_summary ⇒ Object (readonly)
The ScanSummary of the scan
212 213 214 |
# File 'lib/nexpose/scan.rb', line 212 def scan_summary @scan_summary end |
#vuln_other ⇒ Object (readonly)
Vulnerability checks other
217 218 219 |
# File 'lib/nexpose/scan.rb', line 217 def vuln_other @vuln_other end |