Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Adam_Forester
Ambassador
Ambassador

iOS12 Siri Shortcuts and MGMT API

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

5 Replies
Danny
Champion Champion
Champion

Hello, firewall

I love this! ❤️

Now we can finally talk to our Firewalls.

Adam_Forester
Ambassador
Ambassador

Hahaha awesome! I’ve been working on a skill for the Echo too so I can do similar stuff with Alexa. 

Joshua_Hatter
Employee
Employee

Image result for jurassic park didn't stop to think if you should

0 Kudos
Adam_Forester
Ambassador
Ambassador

0 Kudos
Lari_Luoma
Ambassador Ambassador
Ambassador

This is cool! Love it! 🙂

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events