ytti / oxidized

Oxidized is a network device configuration backup tool. It's a RANCID replacement!
Apache License 2.0
2.8k stars 925 forks source link

Http input: not managed error 404 #3213

Open marmack95 opened 4 months ago

marmack95 commented 4 months ago

Hello, I create a very basic model for a specific device : it is almost identical to dlinkcam model.

It work's well, but i notice that HTTP input not manage error: when it don't find the file (error 404), it does not return any error. It save error as config file... Which let you think during weeks that all it's ok, but it's not.

ytti commented 4 months ago

I do wonder whose role is what. What is models role, what is input methods role?

Since obviously in most typical case, we use some CLI like mechanism, like SSH or Telnet, and then we do not have any protocol level notofication about success or failure, so if we want to determine that, then it is obviously model's responsibility to figure it out.

But for HTTP, FTP and others, we can determine some errors, should we raise them, or leave them to model as well?

Could there be use-case, where model wants 404 and wants to act on that? And if we make it error, this use-case cannot be satisfied?

You could of course look at the content of the returned string, and determine it is an error, and then raise error from the model, causing failure for that node to be booked.

marmack95 commented 4 months ago

It's a simple download of file in http. ixoff.txt

I see that you manage error 401 for authentification cases.

But not any other HTML Error code. Error 404 (document not found) is the best known. Error 400 (Bad Request) / 403 (Forbidden) are also frequent.

If i can i manage http code in my model without rewrite all Mechanize code (i do it in Dell Drac model, because i don't find how to do), it's ok for me. But i don't find how.

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 90 days with no activity.