Rundeck offers many features, like search filters, to make a systems administrator's job significantly easier.
With Rundeck up and running, your nodes added, and commands at your fingertips, it's time to make the tool a bit more efficient. You might have a good number of nodes added, so when running commands you find yourself searching for specific nodes to run those commands, one node at a time. This can be a waste of time, especially if the number of nodes grows to data center levels.
What do you do to make this task more expedient? You save search filters. By using this tool you can group your servers in such a way as to run commands on all your web servers or database servers, location specific, or network-specific servers, etc. That's what's so great about Rundeck--it provides the flexibility to make your tasks as easy as you want them.
I will walk you through the process of creating search filters on Rundeck. All you need is an instance of Rundeck up and running and nodes added to the server (How to install Rundeck local and remote services controller on Ubuntu 18.04 and How to run a command in Rundeck).
SEE: Disaster recovery and business continuity plan (Tech Pro Research)
Creating a search filter
This is one of those features that could drive you a bit mad trying to find. If you go to either the Jobs or the Commands page, you can search for Nodes or filters. However, creating a filter isn't quite as obvious. Try this:
- Go to one of your Projects.
- Click on the Nodes option in the left navigation.
- Click the Nodes dropdown and select Show all nodes.
- Click the Actions dropdown.
As you can see (Figure A), you only have the option to set the Show all nodes as the Default Filter. Go ahead and do that, because it's a good filter to have (if you want to run specific commands to all of your associated nodes).
But how do you create a specific filter? In my example, there only two nodes added (besides localhost being the Rundeck server). Those nodes are HIVE and hive4. Say you want to create a filter specific to those machines. To do that, enter the following in the Search field:
Once the search text has been entered, hit the Search button and those two machines will be listed. Now, click the Actions dropdown and click Save Filter (Figure B).
In the resulting popup window (Figure C), give the search a name and click Save Filter.
Using the new filter
Now that you created a new filter, how do you use it? Simple. Say you want to run the same command on all of the nodes in the filter named "hives." To do this, click Projects | Commands and then click the Nodes drop-down. You should see the newly-created filter listed (Figure D). Select the new filter and all associated nodes will populate, ready to receive their commands.
Type your command in the commands space and then click Run on X Nodes (where X is the number of nodes associated with the selected filter). The command will be sent to all nodes in the filter for execution.
And that's how you make use of search filters with Rundeck. With the smallest amount of creativity, you can group nodes together in such a way as to make your Linux data center administration job incredibly easy. And, to make filters even more powerful, it can also be applied when creating jobs.
- How to monitor your data center Linux server with osquery (TechRepublic)
- How to connect an agent to Pandora FMS (TechRepublic)
- How to connect a new host to Zabbix monitoring server (TechRepublic)
- How to run remote commands on multiple Linux servers with Parallel-SSH (TechRepublic)
- At AWS re:Invent, Amazon gets its gun: 'Everything the tech sector does, we can do better' (ZDNet)
- The data center is dead: Here's what comes next (ZDNet)
- Best cloud services for small businesses (CNET)
- DevOps: More must-read coverage (TechRepublic on Flipboard)