Closed PAOK1926 closed 5 years ago
when i do it manually, it works..
graphs are exported as www-data user.
@PAOK1926 Do you have any logs showing up around the time of the automated export? Also can you do the following:
SHOW TABLES LIKE 'graph_exports%';
SHOW CREATE TABLE graph_exports \G
SHOW CREATE TABLE graph_exports_tasks \G
i have more than 1100 graphs.. lots of lines in cacti log.. if you tell me where to search, i will do.. or for which string..
Can you get me the table definitions too? I just want to make sure everything is correct before we start delving into data.
you mean the structure? how ?
Use the two other lines that I put above.
OK, I think it's because you are doing it in phpMyAdmin rather than mysqladmin at the command line. Change the \G to a ; (semi-colon) and we'll see if that helps.
Not much use to me that. Can you do my original commands from mysqladmin in a command line/shell ?
OK thanks. We had an issue with a table layout and I wanted to make sure it didn't apply to you. So, now lets dig into the data.
SELECT id, name, enabled, export_type, export_timing, export_hourly, export_daily, export_threads, status, last_errored, last_error, export_pid, next_start, last_started FROM graph_exports;
OK, so the code thinks it ran OK and I would agree because there is no export_pid. So this makes me wonder if it just isn't pulling out the tree you expect.
Try this query:
select
ge.id, ge.name, ge.graph_max, u.username, u.full_name,
ge.graph_tree, gt.name graphName, ge.graph_site, s.name siteName
FROM graph_exports ge
LEFT JOIN user_auth u ON u.id = ge.id
LEFT JOIN sites s on s.id = ge.graph_site
LEFT JOIN graph_tree gt on gt.id = ge.graph_tree
OK, so we need to see why this is failing, can you run
sudo -u <cacti/website user> poller_export.php --force --debug
it starts like this...
root@Monitor:/opt/cacti# sudo -u www-data /opt/cacti/plugins/gexport/poller_export.php --force --debug 02/Mar/2018 23:30:02 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: This is a forced run 02/Mar/2018 23:30:02 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: Checking export 'Anel Exports' to determine if it's time to run. 02/Mar/2018 23:30:03 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: Running Export for id 1 02/Mar/2018 23:30:03 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: Export Type is 'local' 02/Mar/2018 23:30:03 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: Running graph export 02/Mar/2018 23:30:03 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: There are 1 to export 02/Mar/2018 23:30:03 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: There are 24 to export for all trees. 02/Mar/2018 23:30:03 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Preparing task for Export[1], Graph[364] 02/Mar/2018 23:30:03 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Preparing task for Export[1], Graph[367] 02/Mar/2018 23:30:03 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Preparing task for Export[1], Graph[368] 02/Mar/2018 23:30:03 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Preparing task for Export[1], Graph[369] 02/Mar/2018 23:30:03 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Preparing task for Export[1], Graph[365] 02/Mar/2018 23:30:03 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Preparing task for Export[1], Graph[366] 02/Mar/2018 23:30:03 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Preparing task for Export[1], Graph[361] 02/Mar/2018 23:30:03 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Preparing task for Export[1], Graph[362] 02/Mar/2018 23:30:03 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Preparing task for Export[1], Graph[363] 02/Mar/2018 23:30:03 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Preparing task for Export[1], Graph[370] 02/Mar/2018 23:30:03 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Preparing task for Export[1], Graph[371] 02/Mar/2018 23:30:04 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Preparing task for Export[1], Graph[451] 02/Mar/2018 23:30:04 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Preparing task for Export[1], Graph[449] 02/Mar/2018 23:30:04 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Preparing task for Export[1], Graph[508] 02/Mar/2018 23:30:04 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Preparing task for Export[1], Graph[458] 02/Mar/2018 23:30:04 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Preparing task for Export[1], Graph[554] 02/Mar/2018 23:30:04 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Preparing task for Export[1], Graph[1060] 02/Mar/2018 23:30:04 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Preparing task for Export[1], Graph[1017] 02/Mar/2018 23:30:06 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Preparing task for Export[1], Graph[1023] 02/Mar/2018 23:30:06 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Preparing task for Export[1], Graph[984] 02/Mar/2018 23:30:06 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Preparing task for Export[1], Graph[1025] 02/Mar/2018 23:30:06 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Preparing task for Export[1], Graph[986] 02/Mar/2018 23:30:06 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Preparing task for Export[1], Graph[1026] 02/Mar/2018 23:30:06 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Preparing task for Export[1], Graph[987] 02/Mar/2018 23:30:06 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Preparing task for Export[1], Graph[2027] 02/Mar/2018 23:30:06 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS 0 Database, 0 Active 02/Mar/2018 23:30:06 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS 1 available, 1 found 02/Mar/2018 23:30:06 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Spawning task 1 for Export[1], Graph[364] 02/Mar/2018 23:30:06 - POLLER: Poller[1] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q /opt/cacti/plugins/gexport/poller_export.php --thread=1] 02/Mar/2018 23:30:08 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS 0 Database, 0 Active 02/Mar/2018 23:30:08 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS 1 available, 1 found 02/Mar/2018 23:30:08 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Spawning task 2 for Export[1], Graph[367] 02/Mar/2018 23:30:08 - POLLER: Poller[1] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q /opt/cacti/plugins/gexport/poller_export.php --thread=2] 02/Mar/2018 23:30:10 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS 0 Database, 0 Active 02/Mar/2018 23:30:10 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS 1 available, 1 found 02/Mar/2018 23:30:10 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Spawning task 3 for Export[1], Graph[368] 02/Mar/2018 23:30:10 - POLLER: Poller[1] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q /opt/cacti/plugins/gexport/poller_export.php --thread=3] 02/Mar/2018 23:30:12 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS 0 Database, 0 Active 02/Mar/2018 23:30:12 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS 1 available, 1 found 02/Mar/2018 23:30:12 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Spawning task 4 for Export[1], Graph[369]
and after many similar lines, it ends like this:
02/Mar/2018 23:31:06 - POLLER: Poller[1] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q /opt/cacti/plugins/gexport/poller_export.php --thread=23] 02/Mar/2018 23:31:08 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS 0 Database, 0 Active 02/Mar/2018 23:31:08 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS 1 available, 1 found 02/Mar/2018 23:31:11 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Spawning task 24 for Export[1], Graph[987] 02/Mar/2018 23:31:11 - POLLER: Poller[1] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q /opt/cacti/plugins/gexport/poller_export.php --thread=24] 02/Mar/2018 23:31:13 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS 0 Database, 0 Active 02/Mar/2018 23:31:13 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS 1 available, 1 found 02/Mar/2018 23:31:15 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS Spawning task 25 for Export[1], Graph[2027] 02/Mar/2018 23:31:15 - POLLER: Poller[1] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q /opt/cacti/plugins/gexport/poller_export.php --thread=25] 02/Mar/2018 23:31:17 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS 1 Database, 1 Active 02/Mar/2018 23:31:19 - EXPORT PID: 7351 MEMUSE: 5 M, MESSAGE: TASKS 1 Database, 1 Active 02/Mar/2018 23:31:21 - EXPORT STATS: ExportID:1 (Anel Exports) ExportDate:2018-03-02_23:31:21 ExportDuration:79.14 TotalGraphsExported:25 MaximumThreads: 1 02/Mar/2018 23:31:21 - EXPORT MASTER STATS: Time:79.15 Exports:1 Exported:1
the result is this :(
i case you see something else..
Can you try changing the settings to use 0 threads under the export settings and see what happens?
i did it, it works only manually..
Sorry, I seemed to have missed the update on this. Your response would suggest that the thread isn't spawning or in some way errors. Maybe add a log output to the start of poller_export.php and make sure that it is actually being called in thread mode.
Hi, I'm experiencieng exactly the same as @PAOK1926. Any update about this issue?
In the meantime, i solved by linking the image source, identified by local_graph_id:
<img src="http://cacti/graph_image.php?local_graph_id=52" width="647" height="257" />
Thanks in advance! Giuseppe
That sounds like there is an error occuring in the poller_export when running with the additional parameters. Are you running the latest version?
Also, if you have correctly set the number of threads to 0, then the log output should be different since it wouldn't be using the background threads.
@simpatia or @PAOK1926 is there any feed back on this before I close the issue?
hello again,
a health problem kept me away from this..
anyway, today i downloaded latest version of your plugin, installed it, but it does not export.. i can do it manually, with the "export now" function, but scheduler does not work..
Did you attempt to run it as with zero threads to see if that changed anything ? (It should remove any of the advanced threading code by running it all in a single thread).
i tried both settings, 0 and 1.. no exports..
these are my settings now..
OK, let me see if I can do something to better log what's happening with the background when it's calling the router_download.php file.
Try again. I just made a few minor changes.
@PAOK1926 any update on this? Or shall we close this now?
I've done a few updates. Pretty sure we should be set now.
Hi,
Sorry to re-open this rather old issue but I'm facing the same kind of behaviour while running on v2.0 with cacti in 1.2.22 on a windows envrionment :
CREATE TABLE graph_exports
(
id
int(10) unsigned NOT NULL AUTO_INCREMENT,
name
varchar(64) DEFAULT '',
export_type
varchar(12) DEFAULT '',
enabled
char(3) DEFAULT 'on',
export_presentation
varchar(20) DEFAULT '',
export_effective_user
int(10) unsigned DEFAULT '0',
export_expand_hosts
char(3) DEFAULT '',
export_theme
varchar(20) DEFAULT 'modern',
graph_tree
varchar(255) DEFAULT '',
graph_site
varchar(255) DEFAULT '',
graph_height
int(10) unsigned DEFAULT '100',
graph_width
int(10) unsigned DEFAULT '300',
graph_thumbnails
char(3) DEFAULT '',
graph_columns
int(10) unsigned DEFAULT '2',
graph_perpage
int(10) unsigned DEFAULT '50',
graph_max
int(10) unsigned DEFAULT '2000',
export_clear
char(3) DEFAULT '',
export_thumbs
char(3) DEFAULT 'on',
export_args
char(25) DEFAULT '-zav',
export_directory
varchar(255) DEFAULT '',
export_temp_directory
varchar(255) DEFAULT '',
export_timing
varchar(20) DEFAULT 'disabled',
export_skip
int(10) unsigned DEFAULT '0',
export_hourly
varchar(20) DEFAULT '',
export_daily
varchar(20) DEFAULT '',
export_threads
int(10) DEFAULT '0',
export_sanitize_remote
char(3) DEFAULT '',
export_host
varchar(64) DEFAULT '',
export_port
varchar(5) DEFAULT '',
export_passive
char(3) DEFAULT '',
export_user
varchar(40) DEFAULT '',
export_password
varchar(64) DEFAULT '',
export_private_key_path
varchar(255) DEFAULT '',
status
int(10) unsigned DEFAULT '0',
export_pid
int(10) unsigned DEFAULT NULL,
next_start
timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
last_checked
timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
last_started
timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
last_ended
timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
last_errored
timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
last_runtime
double NOT NULL DEFAULT '0',
last_error
varchar(255) DEFAULT NULL,
total_graphs
double DEFAULT '0',
PRIMARY KEY (id
)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COMMENT='Stores Graph Export Settings for Cacti'
CREATE TABLE graph_exports_tasks
(
id
int(10) unsigned NOT NULL AUTO_INCREMENT,
local_graph_id
int(10) unsigned NOT NULL DEFAULT '0',
export_id
int(10) unsigned NOT NULL DEFAULT '0',
pid
int(10) unsigned NOT NULL DEFAULT '0',
user
int(10) unsigned NOT NULL DEFAULT '0',
folder
varchar(255) DEFAULT '',
status
int(1) unsigned NOT NULL DEFAULT '0',
start_time
int(1) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (id
),
KEY status
(status
),
KEY pid
(pid
),
KEY start_time
(start_time
)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Stores Graph Export Tasks for Cacti'
id;name;graph_max;username;full_name;graph_tree;graphName;graph_site;siteName 2;New Graph Export;2000;\N;\N;;\N;1;Edge
We tried with and without user, with 0 thread and with one, with a focus on one site or not. Currently we only have 44 graphs to export. Running the tasks manually via the export now button is working like a charm (but states that the process errored at the end "Killed outside cacti".
Can you help me troubleshoot this issue?
Regards,
Maxime
hello,
i use version 1.4.1 and it does not export anything. it seems that the job never starts.. I dont know where and what for, to search in log files. please advise.