Send server stats from Slack commands

BotsArtificial IntelligenceDocument/File

What it does

When someone runs a server command in Slack, this automation executes a command-line script on the on-premises agent. The script returns the result to the channel based on the command type.

Who it's for

Engineering teams who need to check server stats from Slack without leaving the conversation.

How teams use this

Check cpu usage from Slack

Run the server command with cpu as the type to get current cpu stats posted back to the channel. The team monitors server health without opening a terminal or dashboard.

Retrieve server IP address

Run the server command with ip as the type to fetch and post the server IP address to Slack. This helps IT troubleshoot connectivity issues in the conversation.

Add memory usage monitoring

Extend the script to include a memory parameter so the command can retrieve memory stats in addition to cpu and IP. Add the new condition and script logic to handle the extra query type.

How it works

  1. Receive the server command. Someone runs a server command in Slack with a parameter like cpu or ip to specify what data to retrieve from the server.
  2. Execute the script on the agent. Run the Get Server Stats script on the on-premises agent, passing the command type as a parameter to the Python program to fetch the requested data.
  3. Post the result to Slack. Reply in the same Slack channel with the script output so the team sees the server stats or IP address right away without opening a terminal.