np422 / op5util Goto Github PK
View Code? Open in Web Editor NEWUtility to do common op5 monitoring server administration tasks from the command line, latest release is 0.1.8
Home Page: https://rubygems.org/gems/op5util
License: MIT License
Utility to do common op5 monitoring server administration tasks from the command line, latest release is 0.1.8
Home Page: https://rubygems.org/gems/op5util
License: MIT License
Helps when debugging
ops@epr-prd-adm:~/ansible-epr-inf$ bin/ansibleGroupMembers prd app-line-a | xargs -L1 -IX op5util downtime X
Downtime Scheduled
Error, Op5util::ApiError
Downtime Scheduled
Downtime Scheduled
Downtime Scheduled
Downtime Scheduled
Downtime Scheduled
Downtime Scheduled
First of all, I would like to thank you for taking your time to develop this, but also for the shared thought of how this can be used with Ansible. Nice touch!
I have gone through your code and a concern I have is the heavy use of /status, but also /config for fetching object information. I would highly recommend that you use the /filter method for that instead, as we may be deprecating the /status method with time. In addition: the /filter method can also give you more control of what information OP5 sends back to the client (with the ?columns= parameter).
Rspcec/minitest?
TASK [op5-add-host : Register client with Op5 monitoring server] *************************************************************************************************
fatal: [epr-int-bpm-a -> localhost]: FAILED! => {"changed": true, "cmd": "op5util -u int-appAnsibleOp5 -p ZsdJCc6AvhDRvXUa6w9L -m 10.30.20.21 add -g conextrade-windows-SOE-base epr-int-bpm-a", "delta": "0:00:01.209163", "end": "2017-08-28 15:41:24.824721", "failed": true, "rc": 1, "start": "2017-08-28 15:41:23.615558", "stderr": "error: Response code: 500, Message: {"error":"Export failed","full_error":{"type":"save in progress"}}", "stderr_lines": ["error: Response code: 500, Message: {"error":"Export failed","full_error":{"type":"save in progress"}}"], "stdout": "New host created\nError, Response code: 500, Message: {"error":"Export failed","full_error":{"type":"save in progress"}}", "stdout_lines": ["New host created", "Error, Response code: 500, Message: {"error":"Export failed","full_error":{"type":"save in progress"}}"]}
changed: [epr-int-proc-a -> localhost]
jag körde två host:ar på en gång
ops@epr-int-adm:~/ansible-epr-inf$ ansible-playbook -i inventories/int/inventory.int playbooks/soe-windows.yml -l epr-int-proc-a,epr-int-bpm-a
Thank you for your addition in the IRC channel #op5, added your tool to https://kb.op5.com/display/COMMUNITY/OP5+Ecosystem
It should be possible to end a downtime for a host, i.e:
For example:
op5util downtime --end HOSTNAME
op5util downtime --delete HOSTNAME
op5util downtime --remove HOSTNAME
show if a host is set to downtime when "op5util hosts --long"
When storing or re-using the output from op5util, it would be nice to be able to skip the ansi coloring.
op5util status | gsed -r "s/\x1B\[([0-9]{1,3}((;[0-9]{1,3})*)?)?[m|K]//g" > some.file
malu@kmg-mcp001:/Users/malu $op5util
acknowledge add add_hostgroups downtime help hostgroups schedule status
op5util list <object>
op5util add <object>
op5util remove <object>
Where object can be one of host, hostgroup, service, checkcommand, contactgroup
Status mostly as-is
Include Perfdata? How display in terminal
ops:~/$ op5util -u monitoruser -p secretpassword -m nonexistent.host.name hosts
^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^CError,
error:
/usr/local/bin/op5util: Interrupt
As per topic.
It would be nice to optionally get a json string as output, perhaps through an optional flag "--json"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.