Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import from Uptime Robot (CSV) #1190

Open
1 task done
BeecherNetworks opened this issue Jan 14, 2022 · 8 comments
Open
1 task done

Import from Uptime Robot (CSV) #1190

BeecherNetworks opened this issue Jan 14, 2022 · 8 comments
Labels
area:deployment related to how uptime kuma can be deployed area:monitor Everything related to monitors area:settings Related to Settings page and application configration feature-request Request for new features to be added

Comments

@BeecherNetworks
Copy link

⚠️ Please verify that this feature request has NOT been suggested before.

  • I checked and didn't find similar feature request

🏷️ Feature Request Type

UI Feature

🔖 Feature description

Uptime Kuma imports and exports in CSV format, however Uptime Robot uses CSV. I'd like to be able to import an Uptime Robot CSV file so I can migrate quickly to Kuma, please.

✔️ Solution

Make CSV an accepted format for import, and add code to convert CSV to JSON before importing using the existing code. The UR CSV columns are,

ID | Type | Status | Friendly Name | URL/IP | Keyword Type | Keyword Value | Port

❓ Alternatives

I could probably do it manually, however it would take as long as adding the monitors manually. It seems logical to have it as a feature, so anyone can do it quickly, which should encourage migration.

📝 Additional Context

No response

@BeecherNetworks BeecherNetworks added the feature-request Request for new features to be added label Jan 14, 2022
@pitichampi
Copy link

pitichampi commented Jan 17, 2022

Hi

I had exactly the same issue. I managed to import all my monitors thanks to this little (unoptimized at all ^^) php script.

First I used a csv to json converter somewhere online, then I stored my json in a variable (called $json in my script)
I didn't need a lot of informations but you can complete this to your use.

$array = json_decode($json,true);

$servs = array();
foreach ($array as $elt){
    $item=array(
        "id"=> $elt["ID"],
            "name"=> $elt["Friendly Name"],
            "url"=> $elt["URL/IP"],
            "method"=> "GET",
            "body"=> null,
            "headers"=> null,
            "hostname"=> null,
            "port"=> null,
            "maxretries"=> 0,
            "weight"=> 2000,
            "active"=> 1,
            "type"=> "keyword",
            "interval"=> 60,
            "retryInterval"=> 60,
            "keyword"=> $elt["Keyword Value"],
            "ignoreTls"=> false,
            "upsideDown"=> false,
            "maxredirects"=> 10,
            "accepted_statuscodes"=> '["200-299"]',
            "dns_resolve_type"=> "A",
            "dns_resolve_server"=> "1.1.1.1",
            "dns_last_result"=> null,
            "pushToken"=> null,
            "notificationIDList"=> '{}',
            "tags"=> '[]'
    );
    $servs[] = $item;
}
$out = json_encode($servs);
$out = str_replace("\/\/","//",$out);
$out = str_replace('"tags":"[]"','"tags": []',$out);
$out = str_replace('"notificationIDList":"{}",','"notificationIDList": {},',$out);
$out = str_replace('"accepted_statuscodes":"[\"200-299\"]",','"accepted_statuscodes": ["200-299"],',$out);

echo $out;

@BeecherNetworks
Copy link
Author

I was only able to get one to import at a time with this, couldn't explain why as it looked right, however I got there in the end, thanks.

For anyone else trying this, you'll need to do an export from Kuma first and enter the output from this into the export, as it only includes the monitors. Also note that the array above uses a "keyword" monitor type rather than the default "http"; you may want to review the other settings too.

@ligouras
Copy link

ligouras commented Feb 7, 2023

I have also created a simple script which uses Socket.io to add monitors from a csv file. It's not an Uptime Robot csv, but I'm adding it here for anyone who may need such functionality.

https://github.com/ligouras/kuma-init

@bencat-sixense
Copy link

For anyone who need it now, there is a tool made 2 month ago:

https://github.com/sandstorm/uptime-robot-to-kuma-helper

@Jetro97

This comment was marked as duplicate.

@Leopere

This comment was marked as duplicate.

@CommanderStorm

This comment was marked as resolved.

@Leopere
Copy link

Leopere commented Apr 17, 2024

For anyone who need it now, there is a tool made 2 month ago:

https://github.com/sandstorm/uptime-robot-to-kuma-helper

I submitted a PR for your repo with some fixes for the Documentation and dockerized a fork of your suggestion on https://git.nixc.us/Nixius/UptimeRobot-Migrator I have no idea if any of this works yet but it made more sense to make it docker in my mind it makes it a touch easier to ensure there's no technical debt accrued once it works.

@CommanderStorm CommanderStorm added area:monitor Everything related to monitors area:deployment related to how uptime kuma can be deployed labels May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:deployment related to how uptime kuma can be deployed area:monitor Everything related to monitors area:settings Related to Settings page and application configration feature-request Request for new features to be added
Projects
None yet
Development

No branches or pull requests

7 participants