Hello,
Is there a way to list the all the scheduled reports created by users ?
The idea is to be able to view the current schedule and help users to schedule them at different times to avoid load on server.
Thank you.
Nagios 5.8.7 / RHEL 7.4
Scheduled reports management
Scheduled reports management
Loïc VAILLANT
Re: Scheduled reports management
The easiest way I've found is to look in /var/spool/cron/apache and correlate them.
I wrote this to parse them from the DB as well:
Put it into a file and call it like this:
I wrote this to parse them from the DB as well:
Code: Select all
<?php
$dbserver = '127.0.0.1';
$dbname = 'nagiosxi';
$username = 'nagiosxi';
$password = 'n@gweb';
try {
$conn = new PDO("mysql:host=$dbserver;dbname=$dbname;charset=utf8mb4","$username","$password");
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
echo "Connected successfully\n";
$sql = "SELECT xi_users.username, xi_usermeta.keyvalue FROM xi_usermeta LEFT JOIN xi_users ON xi_users.user_id = xi_usermeta.user_id WHERE xi_usermeta.keyname = 'scheduled_reports'";
foreach ($conn->query($sql) as $row) {
var_dump(unserialize($row['keyvalue']));
}
} catch (PDOException $e) {
echo "Connection failed: " . $e->getMessage();
exit(3);
}
?>Code: Select all
php filename.phpRe: Scheduled reports management
Hello,
Thank you!
Both solutions work well
This case can be considered as solved.
Thank you!
Both solutions work well
This case can be considered as solved.
Loïc VAILLANT
Re: Scheduled reports management
Great, thanks for the update! Locking and marking as resolved.
Thank you!
Thank you!