Closed Kr3m closed 6 years ago
-Ts
expects a template argument so you need something like:
qstat -Ts mytemplate.txt -P -q3s 96.75.63.49:27960
Is there a way of displaying html without outputting to a file?
I've tried using PHP to load the XML output, but I must be doing something wrong.
<?php system("qstat -xml -P -q3s 96.75.63.49:27960"); ?>
and
<?php $doc = new DOMDocument(); $doc->load('./qtmp.php'); echo $doc->saveXML(); ?>
output: <?xml version="1.0"?>
qstat -Ts q.html -P -q3s 96.75.63.49:27960 output doesn't exist. q.html is empty.
<?php $xml=simplexml_load_file('qtmp.php') or die("Error: Cannot create object"); print_r($xml); ?>
results in an error.
I think your missing the point of the template options. The defines the output format you want, you need to create them, its not where the output goes.
What's strange is using xml output, it outputs just fine if I go directly to the php file, yet for some reason, it won't load from another php file so that I can create a template that iterates over the XML. Oh well. I wish I could find a working example somewhere.
fixed :)
`<?php
function fileAsVar($file){ ob_start(); include($file); $msg = ob_get_contents(); ob_end_clean(); return $msg; }
$xml = simplexml_load_string(fileAsVar('qtmp.php')); print_r($xml);`
qstat -xml -P -q3s 96.75.63.49:27960 works great if I need XML output. However, I'm trying to output a template instead. I've tried qstat -Ts -P -q3s 96.75.63.49:27960, but I get no such file or directory.