bug in perfdataproc.php mv with too many files
Posted: Wed Mar 18, 2015 10:00 am
Minor bug report, I don't need support at this time but wanted to pass this along:
In /usr/local/nagiosxi/cron/perfdataproc.php, files are moved from /usr/local/nagios/var/spool/xidpe/ to /usr/local/nagios/var/spool/perfdata/ with a simple "mv *" command. Normally that works fine, but our perfdata cronjob was broken for a few days (for unrelated reasons). So thousands of files built up in the xidpe dir, and then when we got the perfdata job going again, the mv failed with "Argument list too long". So perfdata wasn't getting processed, and the xidpe dir kept growing.
I moved all the files over manually and perfdata is now working fine. It might be worth replacing the mv with something that can handle large numbers of files - many ways to do it: a find|xargs mv combo, rsync with --remove-source-files, tar/untar pipe, etc.
In /usr/local/nagiosxi/cron/perfdataproc.php, files are moved from /usr/local/nagios/var/spool/xidpe/ to /usr/local/nagios/var/spool/perfdata/ with a simple "mv *" command. Normally that works fine, but our perfdata cronjob was broken for a few days (for unrelated reasons). So thousands of files built up in the xidpe dir, and then when we got the perfdata job going again, the mv failed with "Argument list too long". So perfdata wasn't getting processed, and the xidpe dir kept growing.
I moved all the files over manually and perfdata is now working fine. It might be worth replacing the mv with something that can handle large numbers of files - many ways to do it: a find|xargs mv combo, rsync with --remove-source-files, tar/untar pipe, etc.