This is simply fun with technology and API. Not a supported function or anything.
In iOS12 Apple added in Siri Shortcuts and the ability to create them much like the Automator app on MacOS. Using the shortcut you can SSH into a server and execute commands. A customer of mine challenged me to create something that would check stats on a gateway by using the "run-script" command from the management station.
I created a script that would pull: Memory Usage, CPU Usage, Disk Usage, and Current/Peak Connection from the state table.
On the iPhone I can ask Siri to "Check on my firewall" (this is configurable) and the login would happen, the script would run, and Siri would read back the results.
You can find the script and shortcut app on my github: GitHub - WadesWeaponShed/Siri-And-CheckPoint-API: Fun Side Project using Siri Shortcuts to do Check ...
I'm also updating it with a shortcut to install policy, it will read back the results column of "Fail or Success"
How to Use Stats.sh
Requires iOS 12 and the Shortcuts app from the app store.
Install the Shortcut here to the shortcut application
- Edit the SSH settings for your managment station
- Edit the script text to support your Gateway (You will need to edit the 127.0.0.1 after the -d if this runs on a MDS environment and also edit the name of the Gateway)
- mgmt_cli -r true run-script -d 127.0.0.1 script-name "Status Check" script "sh /home/admin/stats.sh" targets.1 drax --format json | jq --raw-output '.tasks[0]["task-details"][0].statusDescription'
add the stats.sh script to your gateway
Video Demo of Stats.sh:
Video Link : 7911