Ask Your Question
0

problems getting a custom function to work

asked 2018-11-17 07:31:44 -0600

andrew_ketih gravatar image

I am trying to get a custom module that includes a custom function that will add a server to Solarwinds monitoring via their API. When I do a run on a test node, the run fails with the following error

"Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, unexpected token at ..."

Where the rest is a string of XML that is returned from the Solarwinds API. I know this XML is valid and I was able to get this same function to work on ruby on my desktop (I realize that's a classic cliche).

So is there a way to test the ruby code in an environment similar to Puppet's ruby environment, or am I just way off track?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-11-19 09:37:49 -0600

DarylW gravatar image

You should be able to run using the included ruby with your puppet configuration, located under /opt/puppetlabs/puppet/bin/ruby (there may even be an irb under there)

According to https://github.com/puppetlabs/puppet-...

/opt/puppetlabs/puppet *              # ruby-puppet root
    bin *
        facter *
        gem *
        hiera *
        openssl *
        puppet *
        pxp-agent *
        ruby *
        virt-what *
edit flag offensive delete link more

Comments

So I was able to test my code using the ruby binary included with the puppet install on a windows agent, and it worked fine. Not quite sure how to proceed from here, any other suggestions?

andrew_ketih gravatar imageandrew_ketih ( 2018-11-29 07:09:38 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2018-11-17 07:31:44 -0600

Seen: 71 times

Last updated: Nov 19