SHARE
TWEET

NPC Weenig Ware JavaScript

sweenig Jan 14th, 2014 288 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function xr(smgr_host, dev_name) {
  2.         var password='rediscoverme';
  3.         if (prompt('Please enter the password to rediscover this device.') == password) {
  4.                 var xmlDoc = loadXMLDoc('http://' + smgr_host + '/PollerWebService/TopologyService.asmx/DiscoverDevice?deviceNameOrIpAddress=' + dev_name + '&extendedDiscovery=false');
  5.                 var txt = xmlDoc.getElementsByTagName('string')[0].getAttribute('xsi:nil');
  6.                 if (txt == 'true') {
  7.                         alert('Discovery has begun. It may take a while for the newly discovered parameters to be reflected in NPC.');
  8.                 } else {
  9.                         alert('An unknown error has occurred.');
  10.                 }
  11.         } else {
  12.                 alert('The password you entered does not match our records.\nPlease try again.');
  13.         }
  14. }
  15. function xd(smgr_host, dev_name) {
  16.         var password='deleteme';
  17.         if(prompt('Are you sure you want to delete this device?\n\nThis cannot be undone and all historical data will be lost.\n\n\nIf you are sure this is what you want to do, please enter the password to delete this device.')==password){
  18.                 var xmlDoc=loadXMLDoc('http://' + smgr_host + '/PollerWebService/TopologyService.asmx/DeleteDevice?deviceNameOrIpAddress=' + dev_name);
  19.                 var txt=xmlDoc.getElementsByTagName("boolean")[0].childNodes[0].nodeValue;
  20.                 if(txt=='true'){
  21.                         alert('Deletion has begun.');
  22.                 }else{
  23.                         alert('An error has occurred. Deletion was not started.');
  24.                 }
  25.         }else{
  26.                 alert('The password you entered does not match our records.\nPlease try again or contact the NetQoS Administrators for the password.');
  27.         }
  28. }
RAW Paste Data
Top