RUNIT
Log In or Register to download the BES file, and more.

0 Votes

Description

RUNIT

In the spirit of the BigFix Mantra Find More, Fix More, Do More, this task runs any command entered by the operator and logs the output to the RUNIT.log in the besclient Logs folder.  With the power of BigFix you can run any command as Local System on Windows Systems or root on other Systems.  The user will be prompted for the command on execution.

You can also use (Action 2) to retrieve the log with Upload Manager and the review the output on the BigFix Server.

***WARNING*** - It is highly recommended (although not necessary) that you are targetting the correct system and only 1 system - "With great power comes great responsibility"

Revision History:

  • 12/02/2012 - Michael Thompson - Initial creation
  • 2021/02/17 - Michael Thompson - Modified the behaviour of invocation and logging due to unreliable results

Property Details

ID26835
StatusBeta - Preliminary testing ready for more
TitleRUNIT
DomainBESC
CategoryBigFix Management
Download Size0
Sourceinternal
Source IDmickyt71
Source Release Date2/12/2012 12:00:00 AM
KeywordsRemote command execution of any command on any platform
Is TaskTrue
Added by on 2/16/2021 6:02:29 PM
Last Modified by on 2/16/2021 6:02:29 PM
Counters 54 Views / 3 Downloads
User Rating 1 star 2 star 3 star 4 star 5 star * Average over 0 ratings. ** Log In or Register to add your rating.

Relevance

Used in 86 fixlets and 91 analyses   * Results in a true/false
Show indented relevance
true

Actions

Action 1 (default)

Action Link Click here to run RUNIT on an endpoint.
Script Type BigFix Action Script
// Query the user of the command to run
action parameter query "remotecmd" with description "Please provide remote command to run:"
// Check OS
if {name of operating system contains "Win"}
// Run command in Windows context
parameter "logfile" = "{parent folder of client folder of current site}\__Global\Logs\RUNIT.log"
appendfile echo STARTING RUNIT LOGFILE > "{parameter "logfile"}"
appendfile DATE /T >> "{parameter "logfile"}"
appendfile TIME /T >> "{parameter "logfile"}"
appendfile echo --------------------------------------- >> "{parameter "logfile"}"
appendfile echo COMMAND: {parameter "remotecmd"} >> "{parameter "logfile"}"
appendfile {parameter "remotecmd"} >> "{parameter "logfile"}"
delete runit.cmd
move __appendfile runit.cmd
waithidden cmd.exe /c runit.cmd
else
// Run in Linux context
wait /bin/sh -c "{parameter "remotecmd"} > {parent folder of client folder of current site}/__Global/Logs/RUNIT.log"
endif
Success Criteria

This action will be considered successful when the applicability relevance evaluates to false.

Action 2

Action Link Click here to retrieve the RUNIT.log from a system with the Upload Manager.
Script Type BigFix Action Script
// Set the client settings and parameters
setting "_BESClient_ArchiveManager_OperatingMode"="2" on "{parameter "action issue date" of action}" for client
parameter "logFolder" = "{parent folder of client folder of current site}/__Global/Logs"
parameter "logFile" = "RUNIT.log"
setting "_BESClient_ArchiveManager_FileSet-client"="{parameter "logFolder"}/{parameter "logFile"}" on "{parameter "action issue date" of action}" for client

// Suck up the results
archive now
Success Criteria

This action will be considered successful when the applicability relevance evaluates to false.


Sharing

Social Media:
Share this page on Yammer

Comments

Log In or Register to leave comments!
jgstew -
definitely need to be careful with this, can have bad things happen if not careful.