All,
Brand New to SolarWinds. I've gotten the Orion SDK on my Linux machine. I need to pull Node information from SolarWinds in order to munge it and load into my ServiceNow instance. Specifically I'm looking for firmware, os versions etc. I dont know PowerShell or Python, thus I'm attempting the Perl way. I found the query.pl in the Sample dir. I've made these changes but I'm still having no luck getting any data back. Any help is hugely appreciated. Thanks - Be Well
################################################################################
# Configuration
################################################################################
my $username = 'REDACTED'; # user/pass works too for local SW accounts
my $password = 'REDACTED';
my $hostname = 'REDACTED'; # I'm not on the SolarWinds machine, this is just a URL in the form of "solarwinds.foo.com"
print 'Config code: ' . $username . "\n";
print 'Config code: ' . $password . "\n";
print 'Config code: ' . $hostname . "\n";
################################################################################
# Execution
################################################################################
my $client = REST::Client->new();
# don't verify SSL certs
$client->getUseragent()->ssl_opts(verify_hostname => 0);
$client->getUseragent()->ssl_opts(SSL_verify_mode => 'SSL_VERIFY_NONE');
# add authentication header
$client->setHost('https://' . $hostname . ':17778');
$client->addHeader('Authorization', 'Basic ' . encode_base64("$username:$password", ''));
# build query string
my $query = sprintf("SELECT Caption, IPAddress, Uri FROM Orion.Nodes WHERE Vendor = '%s'", 'Cisco'); # I know I have Cisco nodes but I dont know if this is a correct query
print 'Query code: ' . $query . "\n";
my $response = $client->GET('/SolarWinds/InformationService/v3/Json/Query?query=' . $query); # Does this need to be changed for my instance?
print 'responce code: ' . $response . "\n"; # NEVER Get here and I dont know why.