Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perl module for common code. #1

Open
jdwhite opened this issue Mar 6, 2014 · 0 comments
Open

Perl module for common code. #1

jdwhite opened this issue Mar 6, 2014 · 0 comments
Assignees

Comments

@jdwhite
Copy link
Owner

jdwhite commented Mar 6, 2014

Most Xymon tests perform a lot of the same activities such as scraping web pages, testing whether to set a new canonical test color, and sending status reports. I would like to create a Perl module to abstract all that, making the individual test programs more clear, concise, and compact, and providing ease of maintenance of common functions.

I am aware of the Xymon::Client module in CPAN and want to include methods such as send_status, but also want methods for setting the canonical test color like the following:

$myxymon->set_testcolor("yellow");

Xymon::Client::set_testcolor would check to see if the passed argument color is weighted more heavily then the current canonical test color. If so, it becomes the new canonical test color. Regardless, the current canonical test color is returned.

There would also be a Xymon::Client::get_testcolor to fetch the current canonical test color.

Whereas the CPAN Xymon::Client module can be pointed at Xymon config files and can send status updates without being called from Xymon, I prefer that a send_status method not send updates to display servers on their own. In my scripts, I check to see if $ENV{XYMON} is defined and if it is not, the message text is sent to STDOUT. This allows for easy debugging. To mimic the xymon client sending an update, use xymoncmd. I do not feel the module needs to worry about parsing Xymon config files and setting up the proper environment when xymoncmd already does this.

@jdwhite jdwhite self-assigned this Mar 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant