prtg_automation_scripts is a set of scripts for automating tasks leveraging a PRTG and PHPIPAM that can automatically bounce an interface for a PoE endpoint that is not reconnecting after a power event.
The credentials can be swapped out with the preferred credentialling method and credentials themselves. As well modify the API connections to IPAM.
Checks for alarmed sensors, bounces interface to endpoint, auto-acknolwedges, notifies via email of action
The script checks into PRTG first to detect for alarms of "Down" devices. If an alarm is detected the flow is as such:
- Checks if device is part of a group of devices
- If
True
: Proceed forward - Else: Takes no action and moves onto next alarm
- If
- With the IP obtained for PRTG under Device properties, perform an API call to phpIPAM instance to gather network details (Switch, Interface)
- With network details, will make a connection to the switch, check that the interface is
down
, then perform a port-bounce.- sleep 5 secs, then check if interface is seen in
up
status on switch.
- sleep 5 secs, then check if interface is seen in
- Acknoweldge the issue in PRTG (closes issue)
- Send Email Notification out to selected group.