Added detection for CoreOS devices (#8899)

DO NOT DELETE THIS TEXT

#### Please note

> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.

- [ ] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)

#### Testers

If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
This commit is contained in:
CrazyMax
2018-07-16 18:36:42 +02:00
committed by Neil Lathwood
parent 310f7ca401
commit d0943313e2
5 changed files with 50 additions and 0 deletions

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 792 306"><path fill="#53A3DA" d="M136.168 45.527C76.898 45.527 28.689 93.739 28.689 153c0 59.265 48.209 107.474 107.479 107.474 59.252 0 107.465-48.209 107.465-107.474 0-59.261-48.213-107.473-107.465-107.473z"/><path fill="#F1606D" d="M136.168 55.389c-17.283 0-31.941 27.645-37.235 66.069a177.92 177.92 0 0 0-.478 3.746 232.863 232.863 0 0 0-1.458 18.808 227.648 227.648 0 0 0-.175 8.988c0 3.029.058 6.029.175 8.985.245 6.472.735 12.764 1.458 18.811 8.104 1.049 16.769 1.761 25.807 2.099 3.907.146 7.872.233 11.907.233 4.023 0 8-.088 11.895-.233 9.049-.338 17.708-1.05 25.819-2.099.892-.114 1.77-.239 2.659-.368 33.754-4.74 57.235-15.232 57.235-27.428-.001-53.912-43.706-97.611-97.609-97.611z"/><path fill="#FFF" d="M176.541 125.569a49.54 49.54 0 0 0-3.148-4.11c-8.956-10.557-22.297-17.265-37.224-17.265-4.839 0-9.148 7.407-11.907 18.909-1.096 4.586-1.947 9.819-2.495 15.498-.432 4.551-.665 9.391-.665 14.399s.233 9.849.665 14.396c4.554.432 9.387.664 14.402.664 5.009 0 9.842-.232 14.396-.664 10.011-.95 18.653-2.875 24.775-5.411 6.046-2.501 9.624-5.615 9.624-8.985-.001-10.168-3.106-19.612-8.423-27.431z"/><g><path fill="#231F20" d="M344.891 100.053c12.585 0 22.816 6.138 29.262 13.062l-10.064 11.326c-5.353-5.192-11.175-8.495-19.041-8.495-16.839 0-28.953 14.16-28.953 37.291 0 23.448 11.169 37.608 28.32 37.608 9.128 0 15.895-3.775 21.717-10.228l10.067 11.169c-8.335 9.598-19.038 14.95-32.099 14.95-26.119 0-46.731-18.88-46.731-53.025.001-33.675 21.085-53.658 47.522-53.658zM416.961 125.701c19.352 0 36.822 14.793 36.822 40.597 0 25.647-17.471 40.439-36.822 40.439-19.197 0-36.66-14.792-36.66-40.439 0-25.804 17.463-40.597 36.66-40.597zm0 66.244c11.33 0 18.25-10.228 18.25-25.647 0-15.577-6.92-25.804-18.25-25.804s-18.094 10.227-18.094 25.804c0 15.419 6.764 25.647 18.094 25.647zM459.771 127.589h14.943l1.26 13.688h.629c5.506-10.07 13.691-15.577 21.871-15.577 3.938 0 6.455.472 8.811 1.574l-3.148 15.734c-2.67-.784-4.717-1.257-8.018-1.257-6.139 0-13.539 4.245-18.256 15.893v47.203h-18.092v-77.258zM541.121 125.701c20.928 0 31.941 15.107 31.941 36.667 0 3.458-.314 6.604-.787 8.495h-49.09c1.57 14.003 10.379 21.869 22.811 21.869 6.613 0 12.273-2.041 17.941-5.662l6.135 11.326c-7.395 4.878-16.676 8.341-26.432 8.341-21.404 0-38.08-14.95-38.08-40.439.001-25.178 17.463-40.597 35.561-40.597zm16.205 33.675c0-12.277-5.189-19.671-15.732-19.671-9.125 0-16.996 6.768-18.57 19.671h34.302z"/><path fill="#F1606D" d="M600.602 152.607c0-32.729 17.785-53.344 42.799-53.344 24.863 0 42.641 20.615 42.641 53.344 0 32.889-17.777 54.13-42.641 54.13-25.014 0-42.799-21.241-42.799-54.13zm77.888 0c0-28.639-14.158-46.731-35.09-46.731-21.084 0-35.248 18.093-35.248 46.731 0 28.796 14.164 47.521 35.248 47.521 20.932 0 35.09-18.725 35.09-47.521z"/><path fill="#53A4D9" d="M699.738 186.125c7.557 8.495 18.412 14.003 30.529 14.003 15.732 0 25.807-8.499 25.807-20.767 0-12.904-8.494-17.154-18.723-21.717l-15.736-7.082c-8.969-3.936-20.934-10.385-20.934-25.808 0-14.947 12.904-25.492 30.059-25.492 12.588 0 22.658 5.665 28.949 12.435l-4.244 4.878c-5.982-6.452-14.32-10.7-24.705-10.7-13.691 0-22.816 7.239-22.816 18.565 0 11.962 10.385 16.521 17.936 19.985l15.738 6.921c11.486 5.195 21.713 11.647 21.713 27.539s-13.061 27.851-33.201 27.851c-15.107 0-26.75-6.451-34.932-15.576l4.56-5.035z"/></g></svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@@ -0,0 +1 @@
<svg viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid"><path d="M128.008 0C57.418 0 0 57.42 0 128c0 70.584 57.417 128 128.008 128C198.578 256 256 198.584 256 128 256 57.42 198.578 0 128.008 0z" fill="#53A3DA"/><path d="M128.572 11.253c-20.384 0-37.671 32.604-43.915 77.92-.2 1.458-.393 2.933-.564 4.418a274.635 274.635 0 0 0-1.72 22.182 268.485 268.485 0 0 0-.205 10.6c0 3.573.068 7.111.206 10.597.289 7.633.867 15.054 1.72 22.186 9.557 1.237 19.777 2.076 30.436 2.475 4.608.172 9.284.275 14.043.275 4.744 0 9.435-.104 14.029-.275 10.672-.399 20.884-1.238 30.45-2.475 1.052-.135 2.088-.282 3.136-.434 39.809-5.59 67.502-17.965 67.502-32.349-.001-63.582-51.546-115.12-115.118-115.12z" fill="#F1606D"/><path d="M176.187 94.022a58.427 58.427 0 0 0-3.713-4.847c-10.562-12.451-26.297-20.363-43.901-20.363-5.707 0-10.79 8.736-14.043 22.301-1.293 5.41-2.296 11.58-2.943 18.279a180.47 180.47 0 0 0-.784 16.981c0 5.907.275 11.616.784 16.979 5.371.51 11.071.783 16.986.783 5.907 0 11.607-.274 16.978-.783 11.807-1.12 22-3.39 29.22-6.382 7.13-2.95 11.35-6.622 11.35-10.597-.001-11.992-3.663-23.13-9.934-32.351z" fill="#FFF"/></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,11 @@
os: coreos
type: server
group: unix
text: CoreOS
icon: coreos
processor_stacked: true
over:
- { graph: device_processor, text: 'Processor Usage' }
- { graph: device_ucd_memory, text: 'Memory Usage' }
discovery:
- sysDescr_regex: '/^Linux.*coreos/'

35
tests/data/coreos.json Normal file
View File

@@ -0,0 +1,35 @@
{
"os": {
"discovery": {
"devices": [
{
"sysName": "",
"sysObjectID": ".1.3.6.1.4.1.8072.3.2.10",
"sysDescr": "Linux coreos 4.14.48-coreos-r2 #1 SMP Thu Jun 14 08:23:03 UTC 2018 x86_64",
"sysContact": null,
"version": null,
"hardware": "",
"features": null,
"location": null,
"os": "coreos",
"type": "server",
"serial": null,
"icon": "coreos.svg"
}
]
},
"poller": "matches discovery"
},
"bgp-peers": {
"discovery": {
"devices": [
{
"bgpLocalAs": null
}
],
"bgpPeers": [],
"bgpPeers_cbgp": []
},
"poller": "matches discovery"
}
}

View File

@@ -0,0 +1,2 @@
1.3.6.1.2.1.1.1.0|4|Linux coreos 4.14.48-coreos-r2 #1 SMP Thu Jun 14 08:23:03 UTC 2018 x86_64
1.3.6.1.2.1.1.2.0|6|.1.3.6.1.4.1.8072.3.2.10