BigFix task to email file from endpoint to email address

Hello,

My Goal: To create a task/fixlet that will email a YUM log to an email address.
Challenge: scripting the relevance to grab the file I want, and send to an email address

I’ve seen this before, but didn’t get a chance to copy the relevance @ the time

I’d like to be able to have a fixlet/task that will email a file from an endpoint, to a target recipient.

In the working example I saw, the fixlet/task had different actions, that would email a YUM log to a static set of addresses.
(Click here to email log to JoeSmith@company.com)
(Click here to email log to JohnJones@company.com)
(Click here to email log to KathyTaylor@company.com).

I’d like to be able to be able to grab either a yum log, or client log if needed. Typically we don’t have rights to direct access to the endpoints, API accerss, or access to the BigFix root server.

Thank you

Not sure about the “working example” that you have seen. Can you provide more details ? Just in case, take a look at the “Notification service” (see https://help.hcltechsw.com/bigfix/9.5/platform/Platform/Config/sa_commonnotificationusage.html)
It can be used to create a task/fixlet capable to send an email from the BigFix server, typically used in a baseline to notify the status of it.

The yum log files could be retrieved from the clients using the “Archive manager” (see https://help.hcltechsw.com/bigfix/9.5/platform/Platform/Config/c_archive_manager.html)
Then you need some automation (script) to populate the mail body, as I am afraid it doesn’t accept “attachment” but I could be wrong.
Hope it helps

Hi FDA,

Thank you for the response!

I was actually able to find some more info on the original content. It appears I was able to copy the action script used…but I didn’t get much more info at the time.

"#!/bin/sh

cat /root/yum-update-$(date +%Y%m%d)* | mail -s hostname -s address@gmail.com"

Unfortunately I do not have a lot of Linux experience, but I’m going to start playing with this and see if I can make it work.

Since the patching on Linux was done via YUM, and any errors would be logged in the YUM log under that directory, I think the “yum-update-$(date +%Y%m%d)*” part of the command would grab the files with todays date on them…I’m guessing that would normally only be the YUM logs.

Maybe I can sub my email addresses in for the "address@gmail.com" part.

Any thoughts or suggestions would be appreciated, thank you!

I see, your questions are referring more to Linux “staff”, then BigFix :slight_smile:

I’m lucky enough to be new to both BigFix notification, and Linux :wink:

image

Sure, once you have resolved the issue of emailing the log file from the Linux machines, then we can help you to figure out how to automate it with a BigFix action.

1 Like