egrep -vf doesn't work when file is empty

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
sslimani
Posts: 10
Joined: Mon Aug 03, 2020 9:17 am

egrep -vf doesn't work when file is empty

Post by sslimani »

Hi,

I try to write a Nagios agent script to check debsums with ignoring files in /etc/debsums-ignore, so I used the command:
"debsums -cs 2>&1 | egrep -vf "$ignorefile"
This command dosn't work when the file $ignorefile (which is /etc/debsums-ignore) is empty and it gives no result although there are modified files,

Anyone have an idea about this please?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: egrep -vf doesn't work when file is empty

Post by ssax »

I apologize but we don't consult on custom development. I tested the command on my system and seems to work properly with an empty /etc/debsums-ignore file, maybe it's your version of egrep?

Make sure you user (usually nagios user) has access to /etc/debsums-ignore, make sure $ignorefile is always set,

We do offer paid custom development/consulting, if that is something you're interested in you can reach out to [email protected] to get more information/a quote.

Thank you!
Locked