Coverage for tests/routers/resp_json.py: 100%

36 statements  

« prev     ^ index     » next       coverage.py v7.9.1, created at 2025-06-25 05:47 +0000

1success = { 

2 "uuid": "ba2f41f8-3c48-40a6-ab45-3c5e84252c3c", 

3 "action": "DeviceRouter", 

4 "result": { 

5 "success": True 

6 }, 

7 "tid": 1, 

8 "type": "rpc", 

9 "method": "setBoundTemplates" 

10} 

11 

12not_found = { 

13 "uuid": "6662b00f-daec-4d54-a853-deec1867f1fd", 

14 "action": "DeviceRouter", 

15 "result": { 

16 "msg": "ObjectNotFoundException: Cannot find \"Devices/Server/TEST\". KeyError: 'TEST'", 

17 "type": "exception", 

18 "success": False 

19 }, 

20 "tid": 1, 

21 "type": "rpc", 

22 "method": "getInfo" 

23} 

24 

25dc_info = { 

26 "uuid": "58c48961-7b6a-46f1-913e-a1c750fb84d6", 

27 "action": "DeviceRouter", 

28 "result": { 

29 "disabled": False, 

30 "data": { 

31 "connectionInfo": [ 

32 "zCommandUsername, zCommandPassword" 

33 ], 

34 "uuid": "32d1d98b-e352-433b-b93e-c994cc7b9c44", 

35 "name": "TEST", 

36 "severity": "clear", 

37 "id": "TEST", 

38 "meta_type": "DeviceClass", 

39 "inspector_type": "DeviceClass", 

40 "uid": "/zport/dmd/Devices/Server/TEST", 

41 "events": { 

42 "info": { 

43 "count": 0, 

44 "acknowledged_count": 0 

45 }, 

46 "clear": { 

47 "count": 0, 

48 "acknowledged_count": 0 

49 }, 

50 "warning": { 

51 "count": 0, 

52 "acknowledged_count": 0 

53 }, 

54 "critical": { 

55 "count": 0, 

56 "acknowledged_count": 0 

57 }, 

58 "error": { 

59 "count": 0, 

60 "acknowledged_count": 0 

61 }, 

62 "debug": { 

63 "count": 0, 

64 "acknowledged_count": 0 

65 } 

66 }, 

67 "description": "TEST" 

68 }, 

69 "success": True 

70 }, 

71 "tid": 1, 

72 "type": "rpc", 

73 "method": "getInfo" 

74} 

75 

76add_dc = { 

77 "uuid": "f54838a5-d727-4e17-a7d2-7be3692fa7a0", 

78 "action": "DeviceRouter", 

79 "result": { 

80 "msg": "Device Class Added", 

81 "nodeConfig": { 

82 "hidden": False, 

83 "leaf": False, 

84 "uid": "/zport/dmd/Devices/Server/TEST", 

85 "text": { 

86 "count": 0, 

87 "text": "TEST", 

88 "description": "devices" 

89 }, 

90 "id": ".zport.dmd.Devices.Server.TEST", 

91 "hasNoGlobalRoles": False, 

92 "path": "Devices/Server/TEST", 

93 "iconCls": "tree-severity-icon-small-clear", 

94 "zPythonClass": "ZenPacks.zenoss.LinuxMonitor.LinuxDevice", 

95 "children": [], 

96 "uuid": "63228c63-477f-4b94-8f6f-5ec535cf65e6" 

97 }, 

98 "success": True 

99 }, 

100 "tid": 1, 

101 "type": "rpc", 

102 "method": "addDeviceClassNode" 

103} 

104 

105collectors = { 

106 "uuid": "b9f0e31c-b2d7-4655-9438-11f861cdf69f", 

107 "action": "DeviceRouter", 

108 "result": [ 

109 "localhost", 

110 ], 

111 "tid": 1, 

112 "type": "rpc", 

113 "method": "getCollectors" 

114} 

115 

116dev_classes = { 

117 "uuid": "27f2f802-46cd-4691-acd8-f8988e114873", 

118 "action": "DeviceRouter", 

119 "result": { 

120 "totalCount": 120, 

121 "deviceClasses": [ 

122 { 

123 "name": "" 

124 }, 

125 { 

126 "name": "/" 

127 }, 

128 { 

129 "name": "/Server" 

130 }, 

131 { 

132 "name": "/Server/SSH" 

133 }, 

134 { 

135 "name": "/Server/SSH/AIX" 

136 }, 

137 { 

138 "name": "/Server/SSH/AIX/IBM_PowerVM" 

139 }, 

140 { 

141 "name": "/Server/SSH/HP-UX" 

142 }, 

143 { 

144 "name": "/Server/SSH/HP-UX/Itanium" 

145 }, 

146 { 

147 "name": "/Server/SSH/Linux" 

148 } 

149 ], 

150 "success": True 

151 }, 

152 "tid": 1, 

153 "type": "rpc", 

154 "method": "getDeviceClasses" 

155} 

156 

157systems = { 

158 "uuid": "bd04b292-3ebe-4c2d-94eb-bef1147d9fa5", 

159 "action": "DeviceRouter", 

160 "result": { 

161 "totalCount": 1, 

162 "systems": [ 

163 { 

164 "name": "/TestSystem" 

165 } 

166 ], 

167 "success": True 

168 }, 

169 "tid": 1, 

170 "type": "rpc", 

171 "method": "getSystems" 

172} 

173 

174groups = { 

175 "uuid": "f84420aa-105b-4860-a46b-0e6b9e202c1d", 

176 "action": "DeviceRouter", 

177 "result": { 

178 "totalCount": 1, 

179 "success": True, 

180 "groups": [ 

181 { 

182 "name": "/TestGroup" 

183 } 

184 ] 

185 }, 

186 "tid": 1, 

187 "type": "rpc", 

188 "method": "getGroups" 

189} 

190 

191loci = { 

192 "uuid": "53806094-d692-447c-badf-a3e2d788fd47", 

193 "action": "DeviceRouter", 

194 "result": { 

195 "totalCount": 5, 

196 "locations": [ 

197 { 

198 "name": "/Moon Base Alpha" 

199 } 

200 ], 

201 "success": True 

202 }, 

203 "tid": 1, 

204 "type": "rpc", 

205 "method": "getLocations" 

206} 

207 

208devices = { 

209 "uuid": "e942d0b0-e7b0-4769-a6a7-9e7d948bfe0f", 

210 "action": "DeviceRouter", 

211 "result": { 

212 "totalCount": 1, 

213 "hash": "1", 

214 "success": True, 

215 "devices": [ 

216 { 

217 "ipAddressString": "1.2.3.4", 

218 "serialNumber": "1234", 

219 "pythonClass": "ZenPacks.zenoss.LinuxMonitor.LinuxDevice", 

220 "hwManufacturer": { 

221 "uid": "/zport/dmd/Manufacturers/VMware", 

222 "name": "VMware" 

223 }, 

224 "collector": "localhost", 

225 "osModel": { 

226 "uid": "/zport/dmd/Manufacturers/Unknown/products/CentOS release 6.9 (Final)", 

227 "name": "CentOS release 6.9 (Final)" 

228 }, 

229 "productionState": 1000, 

230 "systems": [], 

231 "priority": 3, 

232 "hwModel": { 

233 "uid": "/zport/dmd/Manufacturers/VMware/products/VMware Virtual Platform", 

234 "name": "VMware Virtual Platform" 

235 }, 

236 "tagNumber": "", 

237 "osManufacturer": { 

238 "uid": "/zport/dmd/Manufacturers/Unknown", 

239 "name": "Unknown" 

240 }, 

241 "location": { 

242 "uid": "/zport/dmd/Locations/Moon Base Alpha", 

243 "name": "/Moon Base Alpha", 

244 "uuid": "d800ed1e-e162-4b64-a2aa-94d9d1a44996" 

245 }, 

246 "groups": [], 

247 "uid": "/zport/dmd/Devices/Server/TEST/devices/test.example.com", 

248 "ipAddress": 1234567890, 

249 "events": { 

250 "info": { 

251 "count": 0, 

252 "acknowledged_count": 0 

253 }, 

254 "clear": { 

255 "count": 0, 

256 "acknowledged_count": 0 

257 }, 

258 "warning": { 

259 "count": 0, 

260 "acknowledged_count": 0 

261 }, 

262 "critical": { 

263 "count": 0, 

264 "acknowledged_count": 0 

265 }, 

266 "error": { 

267 "count": 0, 

268 "acknowledged_count": 0 

269 }, 

270 "debug": { 

271 "count": 0, 

272 "acknowledged_count": 0 

273 } 

274 }, 

275 "name": "test.example.com" 

276 } 

277 ] 

278 }, 

279 "tid": 1, 

280 "type": "rpc", 

281 "method": "getDevices" 

282} 

283 

284dev_info = { 

285 "uuid": "f007f1b3-b1cc-402b-ac5f-f029f8fdddd7", 

286 "action": "DeviceRouter", 

287 "result": { 

288 "disabled": False, 

289 "data": { 

290 "productionState": 1000, 

291 "uid": "/zport/dmd/Devices/Server/TEST/devices/test.example.com", 

292 "links": "<a href=\"/zport/dmd/Devices/vSphere/devices/vcenter.example.com/vms/VirtualMachine_vm-1\">Virtual Machine 'test' on vcenter.example.com</a>", 

293 "snmpContact": "", 

294 "osModel": { 

295 "description": "", 

296 "name": "CentOS release 6.9 (Final)", 

297 "meta_type": "SoftwareClass", 

298 "inspector_type": "SoftwareClass", 

299 "id": "CentOS release 6.9 (Final)", 

300 "uid": "/zport/dmd/Manufacturers/Unknown/products/CentOS release 6.9 (Final)" 

301 }, 

302 "hwModel": { 

303 "description": "", 

304 "name": "VMware Virtual Platform", 

305 "meta_type": "HardwareClass", 

306 "inspector_type": "HardwareClass", 

307 "id": "VMware Virtual Platform", 

308 "uid": "/zport/dmd/Manufacturers/VMware/products/VMware Virtual Platform" 

309 }, 

310 "osManufacturer": { 

311 "description": "", 

312 "name": "Unknown", 

313 "meta_type": "Manufacturer", 

314 "inspector_type": "Manufacturer", 

315 "id": "Unknown", 

316 "uid": "/zport/dmd/Manufacturers/Unknown" 

317 }, 

318 "deviceClass": { 

319 "connectionInfo": [ 

320 "zCommandUsername, zCommandPassword" 

321 ], 

322 "uuid": "32d1d98b-e352-433b-b93e-c994cc7b9c44", 

323 "name": "TEST", 

324 "severity": "clear", 

325 "id": "TEST", 

326 "meta_type": "DeviceClass", 

327 "inspector_type": "DeviceClass", 

328 "uid": "/zport/dmd/Devices/Server/TEST", 

329 "events": { 

330 "info": { 

331 "count": 0, 

332 "acknowledged_count": 0 

333 }, 

334 "clear": { 

335 "count": 0, 

336 "acknowledged_count": 0 

337 }, 

338 "warning": { 

339 "count": 0, 

340 "acknowledged_count": 0 

341 }, 

342 "critical": { 

343 "count": 0, 

344 "acknowledged_count": 0 

345 }, 

346 "error": { 

347 "count": 0, 

348 "acknowledged_count": 0 

349 }, 

350 "debug": { 

351 "count": 0, 

352 "acknowledged_count": 0 

353 } 

354 }, 

355 "description": "TEST" 

356 }, 

357 "hwManufacturer": { 

358 "description": "", 

359 "name": "VMware", 

360 "meta_type": "Manufacturer", 

361 "inspector_type": "Manufacturer", 

362 "id": "VMware", 

363 "uid": "/zport/dmd/Manufacturers/VMware" 

364 }, 

365 "snmpVersion": "v3", 

366 "collector": "localhost", 

367 "id": "test.example.com", 

368 "deviceConnectionInfo": "", 

369 "uptime": "40d:14h:01m:00s", 

370 "severity": "clear", 

371 "locking": { 

372 "updates": False, 

373 "deletion": False, 

374 "events": False 

375 }, 

376 "comments": "", 

377 "name": "test.example.com", 

378 "priority": 3, 

379 "snmpCommunity": "public", 

380 "location": { 

381 "uid": "/zport/dmd/Locations/Moon Base Alpha", 

382 "name": "/Moon Base Alpha", 

383 "uuid": "8f37ea37-ee7e-4198-afed-bc8507bbf05b" 

384 }, 

385 "memory": { 

386 "ram": "15.6GB", 

387 "swap": "8.0GB" 

388 }, 

389 "icon": "/zport/dmd/img/icons/server-linux.png", 

390 "priorityLabel": "Normal", 

391 "lastCollected": 1508763898.349612, 

392 "events": { 

393 "info": { 

394 "count": 0, 

395 "acknowledged_count": 0 

396 }, 

397 "clear": { 

398 "count": 0, 

399 "acknowledged_count": 0 

400 }, 

401 "warning": { 

402 "count": 0, 

403 "acknowledged_count": 0 

404 }, 

405 "critical": { 

406 "count": 0, 

407 "acknowledged_count": 0 

408 }, 

409 "error": { 

410 "count": 0, 

411 "acknowledged_count": 0 

412 }, 

413 "debug": { 

414 "count": 0, 

415 "acknowledged_count": 0 

416 } 

417 }, 

418 "systems": [], 

419 "status": True, 

420 "ipAddressString": "1.2.3.4", 

421 "description": "TEST", 

422 "snmpDescr": "", 

423 "groups": [], 

424 "device": "test.example.com", 

425 "sshLink": "ssh://zenoss@1.2.3.4", 

426 "firstSeen": 1506874671.273677, 

427 "snmpSysName": "", 

428 "pythonClass": "Products.ZenModel.Device", 

429 "lastChanged": 1508763892.047559, 

430 "productionStateLabel": "Production", 

431 "serialNumber": "1234", 

432 "uuid": "8c6e927e-1bd7-48b9-b2b3-88fbdc137cc3", 

433 "tagNumber": "", 

434 "meta_type": "Device", 

435 "inspector_type": "Device", 

436 "snmpLocation": "", 

437 "snmpAgent": "", 

438 "ipAddress": 1234567890, 

439 "rackSlot": "" 

440 }, 

441 "success": True 

442 }, 

443 "tid": 1, 

444 "type": "rpc", 

445 "method": "getInfo" 

446} 

447 

448components = { 

449 "uuid": "e884358d-587f-4292-be10-1a69572902be", 

450 "action": "DeviceRouter", 

451 "result": { 

452 "totalCount": 1, 

453 "hash": "1", 

454 "success": True, 

455 "data": [ 

456 { 

457 "deviceName": "test.example.com", 

458 "uid": "/zport/dmd/Devices/Server/TEST/test.example.com/hw/cpus/0", 

459 "icon": "/zport/dmd/img/icons/noicon.png", 

460 "product": { 

461 "description": "", 

462 "name": "AuthenticAMD AMD Opteron(TM) Processor 6274", 

463 "meta_type": "HardwareClass", 

464 "inspector_type": "HardwareClass", 

465 "id": "AuthenticAMD AMD Opteron(TM) Processor 6274", 

466 "uid": "/zport/dmd/Manufacturers/AuthenticAMD/products/AuthenticAMD AMD Opteron(TM) Processor 6274" 

467 }, 

468 "voltage": 0, 

469 "clockspeed": 2199.999, 

470 "id": "0", 

471 "extspeed": 0, 

472 "cacheSizeL2": 2048, 

473 "severity": "clear", 

474 "cacheSizeL1": 0, 

475 "locking": { 

476 "updates": False, 

477 "deletion": False, 

478 "events": False 

479 }, 

480 "name": "0", 

481 "manufacturer": { 

482 "description": "", 

483 "name": "AuthenticAMD", 

484 "meta_type": "Manufacturer", 

485 "inspector_type": "Manufacturer", 

486 "id": "AuthenticAMD", 

487 "uid": "/zport/dmd/Manufacturers/AuthenticAMD" 

488 }, 

489 "events": { 

490 "info": { 

491 "count": 0, 

492 "acknowledged_count": 0 

493 }, 

494 "clear": { 

495 "count": 0, 

496 "acknowledged_count": 0 

497 }, 

498 "warning": { 

499 "count": 0, 

500 "acknowledged_count": 0 

501 }, 

502 "critical": { 

503 "count": 0, 

504 "acknowledged_count": 0 

505 }, 

506 "error": { 

507 "count": 0, 

508 "acknowledged_count": 0 

509 }, 

510 "debug": { 

511 "count": 0, 

512 "acknowledged_count": 0 

513 } 

514 }, 

515 "status": "Up", 

516 "usesMonitorAttribute": False, 

517 "description": "TEST", 

518 "device": { 

519 "productionState": 1000, 

520 "uid": "/zport/dmd/Devices/Server/TEST/devices/test.example.com", 

521 "links": "<a href=\"/zport/dmd/Devices/vSphere/devices/vcenter.example.com/vms/VirtualMachine_vm-1\">Virtual Machine 'test' on vcenter.example.com</a>", 

522 "snmpContact": "", 

523 "osModel": { 

524 "description": "", 

525 "name": "CentOS release 6.9 (Final)", 

526 "meta_type": "SoftwareClass", 

527 "inspector_type": "SoftwareClass", 

528 "id": "CentOS release 6.9 (Final)", 

529 "uid": "/zport/dmd/Manufacturers/Unknown/products/CentOS release 6.9 (Final)" 

530 }, 

531 "hwModel": { 

532 "description": "", 

533 "name": "VMware Virtual Platform", 

534 "meta_type": "HardwareClass", 

535 "inspector_type": "HardwareClass", 

536 "id": "VMware Virtual Platform", 

537 "uid": "/zport/dmd/Manufacturers/VMware/products/VMware Virtual Platform" 

538 }, 

539 "osManufacturer": { 

540 "description": "", 

541 "name": "Unknown", 

542 "meta_type": "Manufacturer", 

543 "inspector_type": "Manufacturer", 

544 "id": "Unknown", 

545 "uid": "/zport/dmd/Manufacturers/Unknown" 

546 }, 

547 "deviceClass": { 

548 "connectionInfo": [ 

549 "zCommandUsername, zCommandPassword" 

550 ], 

551 "uuid": "32d1d98b-e352-433b-b93e-c994cc7b9c44", 

552 "name": "TEST", 

553 "severity": "clear", 

554 "id": "TEST", 

555 "meta_type": "DeviceClass", 

556 "inspector_type": "DeviceClass", 

557 "uid": "/zport/dmd/Devices/Server/TEST", 

558 "events": { 

559 "info": { 

560 "count": 0, 

561 "acknowledged_count": 0 

562 }, 

563 "clear": { 

564 "count": 0, 

565 "acknowledged_count": 0 

566 }, 

567 "warning": { 

568 "count": 0, 

569 "acknowledged_count": 0 

570 }, 

571 "critical": { 

572 "count": 0, 

573 "acknowledged_count": 0 

574 }, 

575 "error": { 

576 "count": 0, 

577 "acknowledged_count": 0 

578 }, 

579 "debug": { 

580 "count": 0, 

581 "acknowledged_count": 0 

582 } 

583 }, 

584 "description": "TEST" 

585 }, 

586 "hwManufacturer": { 

587 "description": "", 

588 "name": "VMware", 

589 "meta_type": "Manufacturer", 

590 "inspector_type": "Manufacturer", 

591 "id": "VMware", 

592 "uid": "/zport/dmd/Manufacturers/VMware" 

593 }, 

594 "snmpVersion": "v3", 

595 "collector": "localhost", 

596 "id": "test.example.com", 

597 "deviceConnectionInfo": "", 

598 "uptime": "40d:14h:31m:00s", 

599 "severity": "clear", 

600 "locking": { 

601 "updates": False, 

602 "deletion": False, 

603 "events": False 

604 }, 

605 "comments": "", 

606 "name": "test.example.com", 

607 "priority": 3, 

608 "snmpCommunity": "public", 

609 "location": { 

610 "uid": "/zport/dmd/Locations/Moon Base Alpha", 

611 "name": "/Moon Base Alpha", 

612 "uuid": "8f37ea37-ee7e-4198-afed-bc8507bbf05b" 

613 }, 

614 "memory": { 

615 "ram": "15.6GB", 

616 "swap": "8.0GB" 

617 }, 

618 "icon": "/zport/dmd/img/icons/server-linux.png", 

619 "priorityLabel": "Normal", 

620 "lastCollected": 1508763898.349612, 

621 "events": { 

622 "info": { 

623 "count": 0, 

624 "acknowledged_count": 0 

625 }, 

626 "clear": { 

627 "count": 0, 

628 "acknowledged_count": 0 

629 }, 

630 "warning": { 

631 "count": 0, 

632 "acknowledged_count": 0 

633 }, 

634 "critical": { 

635 "count": 0, 

636 "acknowledged_count": 0 

637 }, 

638 "error": { 

639 "count": 0, 

640 "acknowledged_count": 0 

641 }, 

642 "debug": { 

643 "count": 0, 

644 "acknowledged_count": 0 

645 } 

646 }, 

647 "systems": [], 

648 "status": True, 

649 "ipAddressString": "1.2.3.4", 

650 "description": "TEST", 

651 "snmpDescr": "", 

652 "groups": [], 

653 "device": "test.example.com", 

654 "sshLink": "ssh://zenoss@1.2.3.4", 

655 "firstSeen": 1506874671.273677, 

656 "snmpSysName": "", 

657 "pythonClass": "Products.ZenModel.Device", 

658 "lastChanged": 1508763892.047559, 

659 "productionStateLabel": "Production", 

660 "serialNumber": "1234", 

661 "uuid": "8c6e927e-1bd7-48b9-b2b3-88fbdc137cc3", 

662 "tagNumber": "", 

663 "meta_type": "Device", 

664 "inspector_type": "Device", 

665 "snmpLocation": "", 

666 "snmpAgent": "", 

667 "ipAddress": 1234567890, 

668 "rackSlot": "" 

669 }, 

670 "monitored": "", 

671 "monitor": False, 

672 "pingStatus": "Up", 

673 "socket": "0", 

674 "uuid": "283a7620-a18c-4b20-a6e1-08f4639c8321", 

675 "meta_type": "CPU", 

676 "inspector_type": "CPU" 

677 } 

678 ] 

679 }, 

680 "tid": 1, 

681 "type": "rpc", 

682 "method": "getComponents" 

683} 

684 

685component_info = { 

686 "uuid": "4f8f0256-1677-43d7-90c2-d42d4e8dc451", 

687 "action": "DeviceRouter", 

688 "result": { 

689 "disabled": False, 

690 "data": { 

691 "deviceName": "test.example.com", 

692 "uid": "/zport/dmd/Devices/Server/TEST/devices/test.example.com/hw/cpus/0", 

693 "icon": "/zport/dmd/img/icons/noicon.png", 

694 "product": { 

695 "description": "", 

696 "name": "AuthenticAMD AMD Opteron(TM) Processor 6274", 

697 "meta_type": "HardwareClass", 

698 "inspector_type": "HardwareClass", 

699 "id": "AuthenticAMD AMD Opteron(TM) Processor 6274", 

700 "uid": "/zport/dmd/Manufacturers/AuthenticAMD/products/AuthenticAMD AMD Opteron(TM) Processor 6274" 

701 }, 

702 "voltage": 0, 

703 "clockspeed": 2199.999, 

704 "id": "0", 

705 "extspeed": 0, 

706 "cacheSizeL2": 2048, 

707 "severity": "clear", 

708 "cacheSizeL1": 0, 

709 "locking": { 

710 "updates": False, 

711 "deletion": False, 

712 "events": False 

713 }, 

714 "name": "0", 

715 "manufacturer": { 

716 "description": "", 

717 "name": "AuthenticAMD", 

718 "meta_type": "Manufacturer", 

719 "inspector_type": "Manufacturer", 

720 "id": "AuthenticAMD", 

721 "uid": "/zport/dmd/Manufacturers/AuthenticAMD" 

722 }, 

723 "events": { 

724 "info": { 

725 "count": 0, 

726 "acknowledged_count": 0 

727 }, 

728 "clear": { 

729 "count": 0, 

730 "acknowledged_count": 0 

731 }, 

732 "warning": { 

733 "count": 0, 

734 "acknowledged_count": 0 

735 }, 

736 "critical": { 

737 "count": 0, 

738 "acknowledged_count": 0 

739 }, 

740 "error": { 

741 "count": 0, 

742 "acknowledged_count": 0 

743 }, 

744 "debug": { 

745 "count": 0, 

746 "acknowledged_count": 0 

747 } 

748 }, 

749 "status": "Up", 

750 "usesMonitorAttribute": False, 

751 "description": "TEST", 

752 "device": { 

753 "productionState": 1000, 

754 "uid": "/zport/dmd/Devices/Server/Zuora/TEST/test.example.com", 

755 "links": "<a href=\"/zport/dmd/Devices/vSphere/devices/vcenter.example.com/vms/VirtualMachine_vm-1\">Virtual Machine 'test' on vcenter.example.com</a>", 

756 "snmpContact": "", 

757 "osModel": { 

758 "description": "", 

759 "name": "CentOS release 6.9 (Final)", 

760 "meta_type": "SoftwareClass", 

761 "inspector_type": "SoftwareClass", 

762 "id": "CentOS release 6.9 (Final)", 

763 "uid": "/zport/dmd/Manufacturers/Unknown/products/CentOS release 6.9 (Final)" 

764 }, 

765 "hwModel": { 

766 "description": "", 

767 "name": "VMware Virtual Platform", 

768 "meta_type": "HardwareClass", 

769 "inspector_type": "HardwareClass", 

770 "id": "VMware Virtual Platform", 

771 "uid": "/zport/dmd/Manufacturers/VMware/products/VMware Virtual Platform" 

772 }, 

773 "osManufacturer": { 

774 "description": "", 

775 "name": "Unknown", 

776 "meta_type": "Manufacturer", 

777 "inspector_type": "Manufacturer", 

778 "id": "Unknown", 

779 "uid": "/zport/dmd/Manufacturers/Unknown" 

780 }, 

781 "deviceClass": { 

782 "connectionInfo": [ 

783 "zCommandUsername, zCommandPassword" 

784 ], 

785 "uuid": "32d1d98b-e352-433b-b93e-c994cc7b9c44", 

786 "name": "TEST", 

787 "severity": "clear", 

788 "id": "TEST", 

789 "meta_type": "DeviceClass", 

790 "inspector_type": "DeviceClass", 

791 "uid": "/zport/dmd/Devices/Server/TEST", 

792 "events": { 

793 "info": { 

794 "count": 0, 

795 "acknowledged_count": 0 

796 }, 

797 "clear": { 

798 "count": 0, 

799 "acknowledged_count": 0 

800 }, 

801 "warning": { 

802 "count": 0, 

803 "acknowledged_count": 0 

804 }, 

805 "critical": { 

806 "count": 0, 

807 "acknowledged_count": 0 

808 }, 

809 "error": { 

810 "count": 0, 

811 "acknowledged_count": 0 

812 }, 

813 "debug": { 

814 "count": 0, 

815 "acknowledged_count": 0 

816 } 

817 }, 

818 "description": "ActiveMQ Servers" 

819 }, 

820 "hwManufacturer": { 

821 "description": "", 

822 "name": "VMware", 

823 "meta_type": "Manufacturer", 

824 "inspector_type": "Manufacturer", 

825 "id": "VMware", 

826 "uid": "/zport/dmd/Manufacturers/VMware" 

827 }, 

828 "snmpVersion": "v3", 

829 "collector": "localhost", 

830 "id": "test.example.com", 

831 "deviceConnectionInfo": "", 

832 "uptime": "40d:14h:41m:00s", 

833 "severity": "clear", 

834 "locking": { 

835 "updates": False, 

836 "deletion": False, 

837 "events": False 

838 }, 

839 "comments": "", 

840 "name": "test.example.com", 

841 "priority": 3, 

842 "snmpCommunity": "public", 

843 "location": { 

844 "uid": "/zport/dmd/Locations/Moon Base Alpha", 

845 "name": "/Moon Base Alpha", 

846 "uuid": "8f37ea37-ee7e-4198-afed-bc8507bbf05b" 

847 }, 

848 "memory": { 

849 "ram": "15.6GB", 

850 "swap": "8.0GB" 

851 }, 

852 "icon": "/zport/dmd/img/icons/server-linux.png", 

853 "priorityLabel": "Normal", 

854 "lastCollected": 1508763898.349612, 

855 "events": { 

856 "info": { 

857 "count": 0, 

858 "acknowledged_count": 0 

859 }, 

860 "clear": { 

861 "count": 0, 

862 "acknowledged_count": 0 

863 }, 

864 "warning": { 

865 "count": 0, 

866 "acknowledged_count": 0 

867 }, 

868 "critical": { 

869 "count": 0, 

870 "acknowledged_count": 0 

871 }, 

872 "error": { 

873 "count": 0, 

874 "acknowledged_count": 0 

875 }, 

876 "debug": { 

877 "count": 0, 

878 "acknowledged_count": 0 

879 } 

880 }, 

881 "systems": [], 

882 "status": True, 

883 "ipAddressString": "1.2.3.4", 

884 "description": "TEST", 

885 "snmpDescr": "", 

886 "groups": [], 

887 "device": "test.example.com", 

888 "sshLink": "ssh://zenoss@1.2.3.4", 

889 "firstSeen": 1506874671.273677, 

890 "snmpSysName": "", 

891 "pythonClass": "Products.ZenModel.Device", 

892 "lastChanged": 1508763892.047559, 

893 "productionStateLabel": "Production", 

894 "serialNumber": "1234", 

895 "uuid": "8c6e927e-1bd7-48b9-b2b3-88fbdc137cc3", 

896 "tagNumber": "", 

897 "meta_type": "Device", 

898 "inspector_type": "Device", 

899 "snmpLocation": "", 

900 "snmpAgent": "", 

901 "ipAddress": 1234567890, 

902 "rackSlot": "" 

903 }, 

904 "monitored": "", 

905 "monitor": False, 

906 "pingStatus": "Up", 

907 "socket": "0", 

908 "uuid": "283a7620-a18c-4b20-a6e1-08f4639c8321", 

909 "meta_type": "CPU", 

910 "inspector_type": "CPU" 

911 }, 

912 "success": True 

913 }, 

914 "tid": 1, 

915 "type": "rpc", 

916 "method": "getInfo" 

917} 

918 

919add_dev = { 

920 "uuid": "d18bb6b3-023b-407f-9775-a9fbcaa49901", 

921 "action": "DeviceRouter", 

922 "result": { 

923 "new_jobs": [ 

924 { 

925 "uuid": "721739ae-2b1d-4613-91e9-681f134a2c49", 

926 "description": "Create test2.example.com under /Server/TEST", 

927 "uid": "/zport/dmd/JobManager" 

928 } 

929 ], 

930 "success": True 

931 }, 

932 "tid": 1, 

933 "type": "rpc", 

934 "method": "addDevice" 

935} 

936 

937move_dev = { 

938 "uuid": "d18bb6b3-023b-407f-9775-a9fbcaa49901", 

939 "action": "DeviceRouter", 

940 "result": { 

941 "new_jobs": [ 

942 { 

943 "uuid": "721739ae-2b1d-4613-91e9-681f134a2c49", 

944 "description": "Move test2.example.com to /Server/TEST", 

945 "uid": "/zport/dmd/JobManager" 

946 } 

947 ], 

948 "success": True 

949 }, 

950 "tid": 1, 

951 "type": "rpc", 

952 "method": "moveDevices" 

953} 

954 

955uc = { 

956 "uuid": "b93045d7-409b-4d2e-9acf-e9c1dd0fdcb2", 

957 "action": "DeviceRouter", 

958 "result": [ 

959 { 

960 "id": "DNS forward", 

961 "description": "Name to IP address lookup", 

962 "uid": "/zport/dmd/userCommands/DNS forward" 

963 }, 

964 { 

965 "id": "DNS reverse", 

966 "description": "IP address to name lookup", 

967 "uid": "/zport/dmd/userCommands/DNS reverse" 

968 }, 

969 { 

970 "id": "ping", 

971 "description": "Is the device responding to ping?", 

972 "uid": "/zport/dmd/userCommands/ping" 

973 }, 

974 { 

975 "id": "snmpwalk", 

976 "description": "Display the OIDs available on a device", 

977 "uid": "/zport/dmd/userCommands/snmpwalk" 

978 }, 

979 { 

980 "id": "snmpwalk_v3", 

981 "description": "snmp version v3 Display the OIDs available on a device", 

982 "uid": "/zport/dmd/userCommands/snmpwalk_v3" 

983 }, 

984 { 

985 "id": "traceroute", 

986 "description": "Show the route to the device", 

987 "uid": "/zport/dmd/userCommands/traceroute" 

988 } 

989 ], 

990 "tid": 1, 

991 "type": "rpc", 

992 "method": "getUserCommands" 

993} 

994 

995local_templates = { 

996 "uuid": "c68b8966-2653-4491-9555-be78255a2585", 

997 "action": "DeviceRouter", 

998 "result": { 

999 "data": [ 

1000 { 

1001 "uid": "/zport/dmd/Devices/Server/TEST/devices/test.example.com/DnsMonitor", 

1002 "label": "DnsMonitor (Locally Defined)" 

1003 } 

1004 ], 

1005 "success": True 

1006 }, 

1007 "tid": 1, 

1008 "type": "rpc", 

1009 "method": "getLocalTemplates" 

1010} 

1011 

1012local_template = { 

1013 "uuid": "966435e6-2c93-482d-be23-8ea20fbd5f6d", 

1014 "action": "TemplateRouter", 

1015 "result": { 

1016 "data": { 

1017 "qtip": "Perform a DNS forward lookup of the device name and check to see that it resolves to the device's manageIp", 

1018 "definition": "/Devices/Server/TEST/devices/test.example.com", 

1019 "hidden": False, 

1020 "leaf": True, 

1021 "description": "Perform a DNS forward lookup of the device name and check to see that it resolves to the device's manageIp", 

1022 "name": "DnsMonitor", 

1023 "text": "/Server/TEST/test.example.com", 

1024 "id": "DnsMonitor..Server.TEST.test.example.com", 

1025 "meta_type": "RRDTemplate", 

1026 "targetPythonClass": "Products.ZenModel.Device", 

1027 "inspector_type": "RRDTemplate", 

1028 "iconCls": "tree-template-icon-bound", 

1029 "children": [], 

1030 "uid": "/zport/dmd/Devices/Server/TEST/devices/test.example.com/DnsMonitor" 

1031 }, 

1032 "success": True, 

1033 "form": { 

1034 "items": [ 

1035 { 

1036 "items": [], 

1037 "xtype": "fieldset" 

1038 } 

1039 ] 

1040 } 

1041 }, 

1042 "tid": 1, 

1043 "type": "rpc", 

1044 "method": "getInfo" 

1045} 

1046 

1047templates = { 

1048 "uuid": "0398d95e-dc4b-45ee-8327-881169e8193e", 

1049 "action": "DeviceRouter", 

1050 "result": [ 

1051 { 

1052 "uid": "/zport/dmd/Devices/Server/TEST/rrdTemplates/Device", 

1053 "path": "/Server/TEST", 

1054 "leaf": True, 

1055 "id": "/zport/dmd/Devices/Server/TEST/rrdTemplates/Device", 

1056 "text": "Device (/Server/TEST)" 

1057 }, 

1058 { 

1059 "uid": "/zport/dmd/Devices/Server/TEST/devices/test.example.com/DnsMonitor", 

1060 "path": "Locally Defined", 

1061 "leaf": True, 

1062 "id": "/zport/dmd/Devices/Server/TEST/devices/test.example.com/DnsMonitor", 

1063 "text": "DnsMonitor (Locally Defined)" 

1064 } 

1065 ], 

1066 "tid": 1, 

1067 "type": "rpc", 

1068 "method": "getTemplates" 

1069} 

1070 

1071dns_template = { 

1072 "uuid": "d11158e2-1a57-44cc-b301-64f38edb4829", 

1073 "action": "TemplateRouter", 

1074 "result": { 

1075 "data": { 

1076 "qtip": "Perform a DNS forward lookup of the device name and check to see that it resolves to the device's manageIp", 

1077 "definition": "/Devices", 

1078 "hidden": False, 

1079 "leaf": True, 

1080 "description": "Perform a DNS forward lookup of the device name and check to see that it resolves to the device's manageIp", 

1081 "name": "DnsMonitor", 

1082 "text": "/", 

1083 "id": "DnsMonitor..", 

1084 "meta_type": "RRDTemplate", 

1085 "targetPythonClass": "Products.ZenModel.Device", 

1086 "inspector_type": "RRDTemplate", 

1087 "iconCls": "tree-node-no-icon", 

1088 "children": [], 

1089 "uid": "/zport/dmd/Devices/rrdTemplates/DnsMonitor" 

1090 }, 

1091 "success": True, 

1092 "form": { 

1093 "items": [ 

1094 { 

1095 "items": [], 

1096 "xtype": "fieldset" 

1097 } 

1098 ] 

1099 } 

1100 }, 

1101 "tid": 1, 

1102 "type": "rpc", 

1103 "method": "getInfo" 

1104} 

1105 

1106device_template = { 

1107 "uuid": "75f49b81-f655-4425-a5a9-e166483b1641", 

1108 "action": "TemplateRouter", 

1109 "result": { 

1110 "data": { 

1111 "qtip": "Linux device monitoring via SSH.", 

1112 "definition": "/Devices/Server/TEST", 

1113 "hidden": False, 

1114 "leaf": True, 

1115 "description": "Linux device monitoring via SSH.", 

1116 "name": "Device", 

1117 "text": "/Server/TEST", 

1118 "id": "Device..Server.TEST", 

1119 "meta_type": "RRDTemplate", 

1120 "targetPythonClass": "Products.ZenModel.Device", 

1121 "inspector_type": "RRDTemplate", 

1122 "iconCls": "tree-template-icon-bound", 

1123 "children": [], 

1124 "uid": "/zport/dmd/Devices/Server/TEST/rrdTemplates/Device" 

1125 }, 

1126 "success": True, 

1127 "form": { 

1128 "items": [ 

1129 { 

1130 "items": [], 

1131 "xtype": "fieldset" 

1132 } 

1133 ] 

1134 } 

1135 }, 

1136 "tid": 1, 

1137 "type": "rpc", 

1138 "method": "getInfo" 

1139} 

1140 

1141ub_templates = { 

1142 "uuid": "15131180-9037-4b7b-a9cc-fb754ab7978e", 

1143 "action": "DeviceRouter", 

1144 "result": { 

1145 "data": [ 

1146 [ 

1147 "Apache", 

1148 "Apache (/Server)" 

1149 ], 

1150 [ 

1151 "DigMonitor", 

1152 "DigMonitor (/Server)" 

1153 ] 

1154 ], 

1155 "success": True 

1156 }, 

1157 "tid": 1, 

1158 "type": "rpc", 

1159 "method": "getUnboundTemplates" 

1160} 

1161 

1162apache_template = { 

1163 "uuid": "88c860ce-5141-4947-a9e3-61533fcdf09c", 

1164 "action": "TemplateRouter", 

1165 "result": { 

1166 "data": { 

1167 "qtip": "Apache metrics via mod_status", 

1168 "definition": "/Devices/Server", 

1169 "hidden": False, 

1170 "leaf": True, 

1171 "description": "Apache metrics via mod_status", 

1172 "name": "Apache", 

1173 "text": "/Server", 

1174 "id": "Apache..Server", 

1175 "meta_type": "RRDTemplate", 

1176 "targetPythonClass": "Products.ZenModel.Device", 

1177 "inspector_type": "RRDTemplate", 

1178 "iconCls": "tree-node-no-icon", 

1179 "children": [], 

1180 "uid": "/zport/dmd/Devices/Server/rrdTemplates/Apache" 

1181 }, 

1182 "success": True, 

1183 "form": { 

1184 "items": [ 

1185 { 

1186 "items": [], 

1187 "xtype": "fieldset" 

1188 } 

1189 ] 

1190 } 

1191 }, 

1192 "tid": 1, 

1193 "type": "rpc", 

1194 "method": "getInfo" 

1195} 

1196 

1197dig_template = { 

1198 "uuid": "19a53446-490f-48f9-a12c-7f1aa7949f91", 

1199 "action": "TemplateRouter", 

1200 "result": { 

1201 "data": { 

1202 "qtip": "DNS query time template with 30 second threshold", 

1203 "definition": "/Devices/Server", 

1204 "hidden": False, 

1205 "leaf": True, 

1206 "description": "DNS query time template with 30 second threshold", 

1207 "name": "DigMonitor", 

1208 "text": "/Server", 

1209 "id": "DigMonitor..Server", 

1210 "meta_type": "RRDTemplate", 

1211 "targetPythonClass": "Products.ZenModel.Device", 

1212 "inspector_type": "RRDTemplate", 

1213 "iconCls": "tree-node-no-icon", 

1214 "children": [], 

1215 "uid": "/zport/dmd/Devices/Server/rrdTemplates/DigMonitor" 

1216 }, 

1217 "success": True, 

1218 "form": { 

1219 "items": [ 

1220 { 

1221 "items": [], 

1222 "xtype": "fieldset" 

1223 } 

1224 ] 

1225 } 

1226 }, 

1227 "tid": 1, 

1228 "type": "rpc", 

1229 "method": "getInfo" 

1230} 

1231 

1232bound_templates = { 

1233 "uuid": "1ba75e4e-5702-4820-96a7-fe2d3e4b859a", 

1234 "action": "DeviceRouter", 

1235 "result": { 

1236 "data": [ 

1237 [ 

1238 "Device", 

1239 "Device (/Server/TEST)" 

1240 ], 

1241 [ 

1242 "DnsMonitor", 

1243 "DnsMonitor (/Server/TEST/test.example.com)" 

1244 ] 

1245 ], 

1246 "success": True 

1247 }, 

1248 "tid": 1, 

1249 "type": "rpc", 

1250 "method": "getBoundTemplates" 

1251} 

1252 

1253or_templates = { 

1254 "uuid": "de5fd36b-8f0c-487a-9cc1-4a8ba7444bd9", 

1255 "action": "DeviceRouter", 

1256 "result": { 

1257 "data": [ 

1258 { 

1259 "uid": "/zport/dmd/Devices/Server/TEST/rrdTemplates/Device", 

1260 "label": "Device (/Server/TEST)" 

1261 } 

1262 ], 

1263 "success": True 

1264 }, 

1265 "tid": 1, 

1266 "type": "rpc", 

1267 "method": "getOverridableTemplates" 

1268} 

1269 

1270lock = { 

1271 "uuid": "9875bbfc-d798-4f80-82ef-e281c380adfb", 

1272 "action": "DeviceRouter", 

1273 "result": { 

1274 "msg": "Locked 1 devices.", 

1275 "success": True 

1276 }, 

1277 "tid": 1, 

1278 "type": "rpc", 

1279 "method": "lockDevices" 

1280} 

1281 

1282resetip = { 

1283 "uuid": "d4f79ebf-a259-468f-ac74-fe20f4ea94a9", 

1284 "action": "DeviceRouter", 

1285 "result": { 

1286 "msg": "Reset 1 IP addresses.", 

1287 "success": True 

1288 }, 

1289 "tid": 1, 

1290 "type": "rpc", 

1291 "method": "resetIp" 

1292} 

1293 

1294prod_state = { 

1295 "uuid": "7578163f-db1e-4532-b7fa-2dad33445134", 

1296 "action": "DeviceRouter", 

1297 "result": { 

1298 "msg": "Set 1 devices to Maintenance.", 

1299 "success": True 

1300 }, 

1301 "tid": 1, 

1302 "type": "rpc", 

1303 "method": "setProductionState" 

1304} 

1305 

1306priority = { 

1307 "uuid": "e3e22b6d-15af-4445-9acc-f2273e6e2ff8", 

1308 "action": "DeviceRouter", 

1309 "result": { 

1310 "msg": "Set 1 devices to Normal priority.", 

1311 "success": True 

1312 }, 

1313 "tid": 1, 

1314 "type": "rpc", 

1315 "method": "setPriority" 

1316} 

1317 

1318set_collector = { 

1319 "uuid": "cc3a45d3-3578-4b6e-9056-3c7412ff3fe4", 

1320 "action": "DeviceRouter", 

1321 "result": { 

1322 "new_jobs": { 

1323 "started": None, 

1324 "uuid": "bd320c54-4325-47a7-baaf-048a22c1a276", 

1325 "description": "Move devices test.example.com to collector localhost", 

1326 "uid": "/zport/dmd/JobManager" 

1327 }, 

1328 "success": True 

1329 }, 

1330 "tid": 1, 

1331 "type": "rpc", 

1332 "method": "setCollector" 

1333} 

1334 

1335remodel = { 

1336 "uuid": "55841c99-83f6-4e84-b4ce-a5f68f1b1ac7", 

1337 "action": "DeviceRouter", 

1338 "result": { 

1339 "success": True, 

1340 "jobId": "8735c0ba-0091-474d-8475-2ae4217aba32" 

1341 }, 

1342 "tid": 1, 

1343 "type": "rpc", 

1344 "method": "remodel" 

1345} 

1346 

1347monitored = { 

1348 "uuid": "083a95c4-52ff-4c22-99d0-b4e28d345574", 

1349 "action": "DeviceRouter", 

1350 "result": { 

1351 "msg": "Set monitoring to False for 1 components.", 

1352 "success": True 

1353 }, 

1354 "tid": 1, 

1355 "type": "rpc", 

1356 "method": "setComponentsMonitored" 

1357} 

1358 

1359lock_c = { 

1360 "uuid": "9875bbfc-d798-4f80-82ef-e281c380adfb", 

1361 "action": "DeviceRouter", 

1362 "result": { 

1363 "msg": "Locked 1 components.", 

1364 "success": True 

1365 }, 

1366 "tid": 1, 

1367 "type": "rpc", 

1368 "method": "lockComponents" 

1369} 

1370 

1371delete_c = { 

1372 "uuid": "62bc1c3b-f7f3-41b1-89af-5b0720d089b6", 

1373 "action": "DeviceRouter", 

1374 "result": { 

1375 "msg": "Components deleted.", 

1376 "success": True 

1377 }, 

1378 "tid": 1, 

1379 "type": "rpc", 

1380 "method": "deleteComponents" 

1381} 

1382 

1383update = { 

1384 "uuid": "62bc1c3b-f7f3-41b1-89af-5b0720d089cc", 

1385 "action": "PropertiesRouter", 

1386 "result": { 

1387 "msg": "Property updated.", 

1388 "success": True 

1389 }, 

1390 "tid": 1, 

1391 "type": "rpc", 

1392 "method": "update" 

1393}