Using puppet to install sensu agent plugins - with an asset on the sensu backend

Hi

I am trying to use puppet to install sensu agents on my Centos 7 and Ubuntu clients. We are slowly migrating away from centos 7 to Ubuntu Jammy.

Sensu is working fine with the Centos clients, but it looks like I need to migrate the sensu plugins from the ruby versions to sensu assets and I am a bit confused by this. The Centos clients are working on the old ruby plugins.

on my ubuntu clients I get this message:

Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install sensu-plugins-ruby' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package sensu-plugins-ruby
Error: /Stage[main]/Sensu::Plugins/Package[sensu-plugins-ruby]/ensure: change from 'purged' to 'present' failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install sensu-plugins-ruby' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package sensu-plugins-ruby

From what I can gather this is something new for Ubuntu Jammy and I need to move to sensu assets.

I am a bit confused by the instructions I have found on the net - and I need some help please.

I have installed one asset via sensuctl and I intend to install 4 more when I get this one working

Here is the output from sensuctl asset list

PS C:\Program Files\sensu\sensuctl\bin> sensuctl asset list
=== ←[0;1;99mWe noticed you are approaching the free usage limit of 100 entities. Please visit https://sensu.io/purchase-subscription to view your available options.←[0m
            ←[0;1;99mName←[0m                                              ←[0;1;99mURL←[0m                                    ←[0;1;99mHash←[0m
──────────────────────────── ───────────────────────────────────────────────────────────────────── ──────────
  ←[0;1;34msensu-pagerduty-handler←[0m     //github.com/.../sensu-pagerduty-handler_1.1.0_linux_amd64.tar.gz     e93ec44
  ←[0;1;34msensu-ruby-runtime←[0m          //github.com/.../sensu-ruby-runtime_0.0.5_centos_linux_amd64.tar.gz   1c9f0af
  ←[0;1;34msensu-slack-handler←[0m         //github.com/.../sensu-slack-handler_1.0.3_linux_amd64.tar.gz         6872086
  ←[0;1;34msensugo-pagerduty-handler←[0m   //github.com/.../sensu-pagerduty-handler_1.1.0_linux_amd64.tar.gz     e93ec44
  ←[0;1;34msensugo-slack-handler←[0m       //github.com/.../sensu-slack-handler_1.0.3_linux_amd64.tar.gz         6872086
PS C:\Program Files\sensu\sensuctl\bin> sensuctl asset add sensu-plugins/sensu-plugins-disk-checks
no version specified, using latest: 5.1.4
fetching bonsai asset: sensu-plugins/sensu-plugins-disk-checks:5.1.4
added asset: sensu-plugins/sensu-plugins-disk-checks:5.1.4

You have successfully added the Sensu asset resource, but the asset will not get downloaded until
it's invoked by another Sensu resource (ex. check). To add this runtime asset to the appropriate
resource, populate the "runtime_assets" field with ["sensu-plugins/sensu-plugins-disk-checks"].
PS C:\Program Files\sensu\sensuctl\bin> sensuctl asset list

This is my puppet code:

class { 'sensu::plugins':
    plugins => ['disk-checks'],
  }

I guess I am pretty sure I have the plugin installed correctly - I am just not sure I have the correct code in puppet to utilize the plugin on the agent.

Any help or guidance appreciated

Hi

Please close this ticket - I have managed to work this out. A bit less complicated that I had thought - no fault here apart from me not reading the manual properly and not really understanding prior configuration of Sensu. All seems to be working now.

Many thanks

James

2 Likes