Skip to content

Instantly share code, notes, and snippets.

@zengxinhui
Created July 9, 2020 10:05
Show Gist options
  • Save zengxinhui/92abf87f7dd7e874016725fb2448f0e4 to your computer and use it in GitHub Desktop.
Save zengxinhui/92abf87f7dd7e874016725fb2448f0e4 to your computer and use it in GitHub Desktop.
Extract vsys name and ip from Panorama GUI
a=$$("div")
for(i=0; i<a.length-5; i++) {
if (a[i].textContent.match(/10\./) && a[i+5].textContent.match(/FW|SDY/)) {
var b=a[i+5].textContent.trim();
var c=a[i].textContent.trim().replace(/\/.*/, "");
console.log(`update devices set hostname="${b}" where ip="${c}";`);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment