Thanks checking this out. I will add more info. Only the first two includes are being used, these are part of the jpgraph suite that calls all the functions that help build the graph.
These are the only 2 that are actually being used here. I will attach those to this response.
Using the code without the servers array, and the mysql query to just one host works fine. And even how I have it pasted above with the servers array it does output the first host graph.
I've used jpgraph before to graph output from a single DB query, but haven't tried doing this where I want to loop through multiple DB queries and have it create a graph for each iteration.
The problem I am having is that I am doing something incorrectly with the generation of the graphs because I only get the output of that first one. I actually half expected that I would get the output of the last host graph, due to it overwriting all of the others when generating the graph, but that doesn't seem to be the case. The output is a graph showing my mem,cpu and load usage for host1.
The suggestion to make $graph into an array is a good idea and I will try that. My other thought was somehow getting the output for each member of servers array to be placed in a separate image file.