Guest User

Untitled

a guest
Dec 6th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. <?php
  2.  
  3. # host where manager is running
  4. $host = '192.168.2.8';
  5. # port manager is listen on
  6. $port = 9390;
  7. # Username for manager login.
  8. $username = 'admin';
  9. # password for manager login
  10. $password = 'admin';
  11.  
  12. require 'omp.class.php';
  13.  
  14. $omp = new omp ( $host, $port ); # open connection to manager
  15.  
  16. if( ! $omp->login( $username, $password ) ) { # login and start session with manager
  17.  
  18. print "Could not login into Manager\n";
  19. exit ( 255 );
  20.  
  21. }
  22.  
  23. $report_filter = "hml";
  24.  
  25. print "Generating html report...\n";
  26.  
  27. # where should the file be written
  28. $html_file = "/tmp/report_" . $task_id . ".html";
  29.  
  30. if ( $html_content = base64_decode( $omp->get_last_report_for_task( '12345', 'html', $report_filter ), TRUE ) ) {
  31.  
  32. if ( file_put_contents( $html_file, $html_content ) ) {
  33. print "HTML $html_file created\n";
  34. }
  35. }
  36.  
  37. ?>
Add Comment
Please, Sign In to add comment