Open D4rkMindz opened 4 years ago
I just added a name
field in the .host
file. on the root level of the JSON object.
Please use this field.
{
"name": "Name of the object",
"type": "UPLINK",
"required": [
"host_name",
"alias",
"address",
"check_interval"
],
"config": ["etc..."],
}
First create a new
feature/display-host
and immediately create a "Draft Pull Request" on GitHub. All host configs are defined in/data/hosts/
within the*.host
file. Those files contain json which can be parsed with the nativejson_decode
method. Make sure that it returns an associative array by setting its second argument totrue
. Then iterate over the hosts and get the value of thehost_name
of each host. The reading and restructoring of the data must happen in dedicated Service class. Use thehttps://cdn.pixabay.com/photo/2013/07/13/10/17/computer-156948__340.png
-URL for the image (this URL is fine for now, we'll adjust that later). Make sure that the array still has the same structure after your changes. Big Plus if you use the dedicatedNagiosExplorer
Service class for reading the files. This Service class uses the league/flysystem library for an abstraction of the file system.