Skip to content

Commit

Permalink
update README to reflect API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtazz committed Dec 9, 2015
1 parent 0d8e20f commit 859e3e9
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ advanced features I'd recommend checking that out.
![yagd look](http://s3itch.unwiredcouch.com/Dashboards-20151108-214111.jpg)

## Requirements
- PHP >= 5.4
- PHP >= 5.5
- Graphite

## Installation
Expand Down Expand Up @@ -58,7 +58,6 @@ Configure hosts in your `config.php`
$CONFIG['hosts'] = [
"foo.example.com" => [
"cpus" => 2,
"apache" => true,
"filesystems" => [ 'root', 'var', ]
],
"additional_metrics" => [
Expand All @@ -84,21 +83,21 @@ use Yagd\CollectdHost;
use Yagd\Page;
$page = new Page($CONFIG);
echo $page->get_header($CONFIG["title"],
echo $page->getHeader($CONFIG["title"],
$CONFIG["navitems"]);
foreach($CONFIG["hosts"] as $host => $data) {
$fss = empty($data["filesystems"]) ? [] : $data["filesystems"];
$server = new CollectdHost($host, $data["cpus"], $fss, ($data["apache"] == true),
$server = new CollectdHost($host, $data["cpus"], $fss,
$data["interfaces"]);
$server->set_graphite_configuration($CONFIG["graphite"]["host"]);
$server->setGraphiteConfiguration($CONFIG["graphite"]["host"]);
echo "<h2> {$host} </h2>";
$server->render();
}
echo $page->get_footer();
echo $page->getFooter();
```

Expand All @@ -121,7 +120,7 @@ $selectbox .= "</select>";
$selectbox .= "</form>";
$page = new Page($CONFIG);
echo $page->get_header($CONFIG["title"],
echo $page->getHeader($CONFIG["title"],
$CONFIG["navitems"],
$selectbox);
Expand Down

0 comments on commit 859e3e9

Please sign in to comment.