Skip to main content
Solved

How to list up all the devices with EOL/S date?

  • December 27, 2024
  • 2 replies
  • 80 views
  • Translate

  • Ramping Up
  • 3 replies

Hi all,

 

I am new to NQE and trying to find out a way to list up all the devices with the EOL/S status.

Here is the script which the first phase.

/**

* @intent End-of-life data for operating systems

*

* @description If  EoL data is known for the OS of a device,

* then that device shows the respected dates, if not EoS related columns shows null.

*

* Data exists for devices running any of these OSes:

* ARISTA_EOS, IOS, IOS_XE, IOS_XR, JUNOS, NXOS, and PAN_OS.

 */

 

foreach device in network.devices

let platform = device.platform

let osSupport = platform.osSupport

/* where isPresent(osSupport) */

select {

  Device: device.name,

  Vendor: platform.vendor,

  Model: platform.model,

  OS: platform.os,

  "OS Version": platform.osVersion,

  "End of OS maintenance": osSupport?.lastMaintenanceDate,

  "End of OS vulnerability": osSupport?.lastVulnerabilityDate,

  "End of OS support": osSupport?.lastSupportDate,

  URL: osSupport?.announcementUrl,

  Location: device.locationName,

  Tags: device.tagNames,

  "Collection IP": device.snapshotInfo.collectionIp,

  "Management IP(s)": platform.managementIps,

  Type: platform.deviceType

}

 

When this NQE is executed, as you can see, for BIG-IP devices it shows null.

I am thinking of extending this script to make it more clear.

If the device os != EOS, IOS, IOS-XE, IOS-XR, JUNO, NXOS, PANOS

then the field shows, something like “not support on Forward Enterprise”

 

If the device OS matches any of the supported devices, i.e. EOS, IOS, IOS-XE, IOS-XR, JUNO, NXOS, PANOS, and it has a EOL/S date, those three fields “OS maintenance”, “OS vulnerability”, “OS support” shows the respected dates.

Else, for these suppoted devices, these three fields shows “no announcement yet”.

 

Any one can help me write this script?

Thank you in advance.

 

Hadi

Best answer by GaryB

@Hadi Hello Hadi, Hope you had a great week and thanks for the question.

You can use a few helper functions to achieve this.


 

supported_os =
  [OS.ARISTA_EOS, OS.IOS, OS.IOS_XE, OS.IOS_XR, OS.JUNOS, OS.NXOS, OS.PAN_OS];

isSupported(OS) = if OS in supported_os then true else false;

foreach device in network.devices
let platform = device.platform
let osSupport = platform.osSupport

select {
  Device: device.name,
  Vendor: platform.vendor,
  Model: platform.model,
  OS: platform.os,
  EOSSupport: if isSupported(platform.os)
              then "Supported"
              else "Not Supported on Forward Enterprise",
  "OS Version": platform.osVersion,
  "End of OS maintenance": if isSupported(platform.os)
                           then toString(osSupport?.lastMaintenanceDate)
                           else "No Annoncement Yet",
  "End of OS vulnerability": if isSupported(platform.os)
                             then toString(osSupport?.lastVulnerabilityDate)
                             else "No Annoncement Yet",
  "End of OS support": if isSupported(platform.os)
                       then toString(osSupport?.lastSupportDate)
                       else "No Annoncement Yet",
  URL: osSupport?.announcementUrl,
  Location: device.locationName,
  Tags: device.tagNames,
  "Collection IP": device.snapshotInfo.collectionIp,
  "Management IP(s)": platform.managementIps,
  Type: platform.deviceType
}

 

View original
Did this topic help you find an answer to your question?

2 replies

Forum|alt.badge.img+1
  • Employee
  • 55 replies
  • Answer
  • December 27, 2024

@Hadi Hello Hadi, Hope you had a great week and thanks for the question.

You can use a few helper functions to achieve this.


 

supported_os =
  [OS.ARISTA_EOS, OS.IOS, OS.IOS_XE, OS.IOS_XR, OS.JUNOS, OS.NXOS, OS.PAN_OS];

isSupported(OS) = if OS in supported_os then true else false;

foreach device in network.devices
let platform = device.platform
let osSupport = platform.osSupport

select {
  Device: device.name,
  Vendor: platform.vendor,
  Model: platform.model,
  OS: platform.os,
  EOSSupport: if isSupported(platform.os)
              then "Supported"
              else "Not Supported on Forward Enterprise",
  "OS Version": platform.osVersion,
  "End of OS maintenance": if isSupported(platform.os)
                           then toString(osSupport?.lastMaintenanceDate)
                           else "No Annoncement Yet",
  "End of OS vulnerability": if isSupported(platform.os)
                             then toString(osSupport?.lastVulnerabilityDate)
                             else "No Annoncement Yet",
  "End of OS support": if isSupported(platform.os)
                       then toString(osSupport?.lastSupportDate)
                       else "No Annoncement Yet",
  URL: osSupport?.announcementUrl,
  Location: device.locationName,
  Tags: device.tagNames,
  "Collection IP": device.snapshotInfo.collectionIp,
  "Management IP(s)": platform.managementIps,
  Type: platform.deviceType
}

 

Translate

  • Author
  • Ramping Up
  • 3 replies
  • December 30, 2024

Thank you so much, Gary :)
Perfect! This is what I was looking for 😊

Regards,

Hadi​​​

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings