It's complex problem, made harder by the various technologies in use. Options like Symphony Link, Sigfox, and many LoRaWAN providers have much of this functionality built it.
With a "IP" technology like LTE-M, you need to work with a platform that provides these features, or create your own. If you're looking to implement your own, you could look at Salt-Stack or Resin.io
One thing to keep in mind, many of this options were not built with minimizing data transfer in mind, and you might blow through a lot of data just sending heartbeats, etc.