Intro
If you are a Windows power user, you are likely quite aware of the power you can get from PowerShell.
You can harness that same power with the Dataset Agent.
The dataset agent can run a shell or PowerShell command on a scheduled interval and log the output.
This is helpful if you want to gather metrics about a specific process. You can write a PowerShell script to process the information and log it directly to Dataset.
Once it is logged to Dataset, you can perform queries on enormous datasets with PowerQueries you would not be able to do on a single system, monitor various tools, configurations, and other logs.
Pre Reqs
- Windows x64 system (32 bit not supported)
- Dataset Agent
Instructions
2. Navigate to path
C:\Program Files (x86)\Scalyr\config\agent.json
3. Input monitor config
{
module: "scalyr_agent.builtin_monitors.shell_monitor",
id: "cmd",
command: "powershell -command \"" +
"Get-Process"
+ "\""
log_all_lines: "True"
max_characters: "10000"
sample_interval: 60
},
Alternatively, you can execute the command and log the output to a file and use the agent to pick up the file.
logs: [
{
path: "C:\\Program Files (x86)\\Scalyr\\log\\process-metrics-full.log", attributes: {parser: "process"}
}
],
monitors: [
{
module: "scalyr_agent.builtin_monitors.shell_monitor",
id: "cmd",
command: "powershell -command \"" +
"Get-Process | Out-File -FilePath '%programfiles(x86)%\\Scalyr\\log\\process-metrics-full.log' -Append -Encoding ASCII" + "\""
sample_interval: 60
},
]
Comments
0 comments
Please sign in to leave a comment.