I’m not after uptime monitoring… but instead I would like to be notified the moment a site disconnects. As yet I can’t find a way to do this. Any ideas?
Hey @xyzulu
While this is not possible out of the box, an automation can be made utilizing the MainWP’s REST API.
We’ve made two videos in which we show off an automation which checks for disconnected sites, attempts to reconnect them, and if it fails to do so, it sends a message/alert.
Using Make: https://www.youtube.com/watch?v=DBfdkV9taog
Using Zapier: https://www.youtube.com/watch?v=ExZLwhMyn5g
Thanks for the tips… I prefer using self hosted automation products… but these steps will allow me to setup my own automation to do what I need now.
Thanks again
Excellent request! I never think of that and since it happens every week for us with more than 200 websites, I am going to implement it with n8n. Thanks @xyzulu and @bojan for question and solution. Just save us 10 min per day or so! Yay,
That is the exact solution I was configuring today. Give me a reason to setup n8n as well… nice bit of open source software for sure.
Hi @xyzulu, well it is up to you to decide what you want to use for your workflow. We chose n8n for the same reason we chose MainWP: open source and hosted on our servers. 100% control over it. And n8n, there is so much you can do. We are using all over the place from Ai to Email to CRM and now MainWP.
Hello, trying to set it up with n8n but ran into an issue…
If I use https://myamazingmainwpwebsite.com/wp-json/mainwp/v2/sites/reconnect/ - I got the result below:
[
{
"total":
0,
"data":
[
]
}
]
But if I specify the ID of the disconnected site: http://myamazingmainwpwebsite.com/)/wp-json/mainwp/v2/sites/reconnect//?include={{ $json.data[0].id }} - it worked!
[
{
"total":
1,
"data":
{
"2":
"failed"
}
}
]
If I turn MainWP Child on, it reconnects too, no issue but with the specific ID not the generic URL:
[
{
"total":
1,
"data":
{
"2":
"success"
}
}
]
Any idea what I am missing?
Thanks
Hey @wpexpert
This is the expected behavor.
The /sites/reconnect/
calls requires you to specify an array of ID(s) which you want to reconnect.
So you would need to grab the IDs of disconnected sites from the previous call /sites/?status=disconnected
and use them in the reconnect
call.