using a script to download images of graphs
I would like to have a script download the graphs nagiosgrapher produces into files. I would like to incorporate those files into an email and send it off everyday.
I am using a php script to emulate the links that are provided by nagiosgrapher for the png filetype on a graph. That link includes a number of posted variables to allow the cgi script to make the graph. I get a png file created with the following error on it;
RRD Error: start time: unparsable time:
Here is the link that I am attempting to emulate from the live webpage;
https:/
Here is a listing of the code I have to emulate that link:
#!/usr/bin/php
<?php
$ch = curl_init();
$right_now=time();
$fields = array(
'host'
'service'
'width'
'height'
'type'
'title'
'start'
'end'=
'imageformat'
);
$url="https:/
$fp = fopen("test.png", "w");
curl_setopt(
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_
curl_setopt($ch, CURLOPT_USERPWD, "guest:");
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
$results=
fclose($fp);
?>
I have tried many different forms of start time to see if the error would at least change, but it does not. I found a few items on the web that sugest the it might be a php variable issue, specifically register_globals needs to be off. It is, but that does not seem to be my problem.
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- rayKwebster
- Solved:
- Last query:
- Last reply: