D4rkMindz / box

0 stars 0 forks source link

Display hosts based on hosts file #1

Open D4rkMindz opened 4 years ago

D4rkMindz commented 4 years ago

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 native json_decode method. Make sure that it returns an associative array by setting its second argument to true. Then iterate over the hosts and get the value of the host_name of each host. The reading and restructoring of the data must happen in dedicated Service class. Use the https://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 dedicated NagiosExplorer Service class for reading the files. This Service class uses the league/flysystem library for an abstraction of the file system.

D4rkMindz commented 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..."],
}