[Xymon] mozilla observatory
Henrik Størner
henrik at hswn.dk
Mon Sep 5 10:11:20 CEST 2016
Den 05-09-2016 09:23, Cédric BRINER skrev:
> Hi,
>
> Recently, Mozilla has announced some tools that gives grade for
> website. You can get a look of what I'm talking by going to:
> https://observatory.mozilla.org
>
> For example, you can through the api do:
>
> curl --data "hidden=true"
>
> https://http-observatory.security.mozilla.org/api/v1/analyze?host=www.unige.ch
> {
> "end_time": "Sun, 04 Sep 2016 19:48:54 GMT",
> "grade": "F",
> "response_headers": {
> "Accept-Ranges": "bytes",
> "Connection": "Keep-Alive",
> "Content-Length": "153",
> "Content-Type": "text/html",
> "Date": "Sun, 04 Sep 2016 19:48:53 GMT",
> "Keep-Alive": "timeout=15, max=100",
> "Server": "Apache"
> },
> "scan_id": 1579077,
> "score": 0,
> "start_time": "Sun, 04 Sep 2016 19:48:50 GMT",
> "state": "FINISHED",
> "tests_failed": 6,
> "tests_passed": 5,
> "tests_quantity": 11
> }
>
>
> I would love to be able to display and monitor the grade.
>
> Can someone tell me what is the best way to do this?
Some scripting will be required. You can use the curl command to get
the data, then e.g. "jq" to pick out the individial fields you want to
track. E.g.
GRADE=`curl -s -k
https://http-observatory.security.mozilla.org/api/v1/analyze?host=www.unige.ch
| jq -r .grade`
case $GRADE in
F) COLOR=red ;;
E|D|C) COLOR=yellow ;;
A|B) COLOR=greed ;;
esac
and then generate a normal status report - see the example on how to
create custom tests at https://xymon.com/help/xymon-tips.html#scripts
Regards,
Henrik
More information about the Xymon
mailing list