Topic by Rajan Davis
Content
I was wondering how I could create a custom script to scan ports based on an IP Address and port values entered into an incident. I have included a PHP Code block that demonstrates how to do this with a browser; I need to have something similar but scan multiple IP Addresses and ports (if possible). Where I am getting lost is how the report and the script will access these objects; I am not looking for someone to write a script but help me understanding how to access that information.
In pseudo code, I would like to do the following:
-create a variable that is an array for incidents.
-loop through each incident
-for each incident, if there is an IP Address, HTTP Port, and Server Port, I want to check if these ports are open
-if neither are open, return 'both are closed'
-else if one is open but not the other, return 'the $opened_port is open, the !$opened_port is closed'
-else/if both are open, return 'Both ports are open; click here to login'
-close loop