Bug 2222455 - check_log fills /tmp and contains debug statement
Summary: check_log fills /tmp and contains debug statement
Keywords:
Status: NEW
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: nagios-plugins
Version: epel9
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Guido Aulisi
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-12 20:03 UTC by christopher.gefvert
Modified: 2023-07-20 06:25 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description christopher.gefvert 2023-07-12 20:03:41 UTC
Description of problem:

1)

Starting with version 2.4.4 the plugin script check_log creates $templog    ${TMPDIR}/temp_check_log.XXXXXXXXXX     starting at line 214.

This temp file is copied to from the target log like /var/log/messages.

cp "$logfile" "$templog"
logfile=$templog

And used for a diff.

diff "$logfile" "$oldlog" | grep -v "^>" > "$tempdiff"

After getting what’s needed, $tempdiff is cleaned up and $oldlog replaced.

rm -f "$tempdiff"
cat "$logfile" > "$oldlog"

This leaves the temp file      $logfile    ${TMPDIR}/temp_check_log.XXXXXXXXXX       behind which has been filling my /tmp folders.   If I missed something let me know, but I suspect this temp file, new in 2.4.4 should be deleted after the cat.  Or change the cat to mv.


2) 

Also check_log v2.4.4 line 209….

echo "$TMPDIR"

…trips up the GUI display.  Looks like a testing comment that needs to be removed.




Version-Release number of selected component (if applicable): 

nagios-plugins-log.x86_64  2.4.4-1.el9


How reproducible: 

/usr/lib64/nagios/plugins/check_log   -F /var/log/messages -O /tmp/messages.nagios -q NOTICE



Steps to Reproduce:
1.
2.
3.

Actual results:



Expected results:


Additional info:

Comment 1 Jan ONDREJ 2023-07-20 06:25:00 UTC
If this is a check_log nagios plugin problem, why this bug is filled against nrpe? It's a different package. Reassinging to nagios-plugins.


Note You need to log in before you can comment on or make changes to this bug.