Request for an action function on the Manage Plugins page

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Request for an action function on the Manage Plugins page

Post by Box293 »

Let me explain.

I'm a Windows user, learning linux as I need to.

I had an issue where I uploaded a script via the Manage Plugins page.
The problem was because I downloaded the plugin onto a Windows PC and then uploaded it via the Manage Plugins page.
Something about Windows files having a differernt character return to unix files?
Anyway the fix was to run the command dos2unix <pluginname> and the file was fixed. Success I was able to run the plugin.

Now, back to me being a Windows user.
I worked all this out by searching the web etc etc etc. So I had to go and find the location of the script file (not referenced on the plugins page). Now that sucker is hard coded into my brain :lol:
So this can get a little frustrating walking around in the dark.

So I had an idea.
It would be good if there was an Action command on the plugin page.
Perhaps you could tick the plugin and then have a drop down list with actions in them.
One action could be running dos2unix against the plugin.
Another action could be to view the plugin on the screen.
And I'm sure others have ideas here.
It would also be good if we could define our own "actions".
Each action could have a description box explaining what the purpose of this action is.

Hope this makes sense.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
mmestnik
Posts: 972
Joined: Mon Feb 15, 2010 2:23 pm

Re: Request for an action function on the Manage Plugins page

Post by mmestnik »

I think you are looking for the alias shell internal command.

man bash; # Yes I know it's huge, it's a reference for sure. Skim to the part about: alias tryit="echo Hello World;"
mmestnik
Posts: 972
Joined: Mon Feb 15, 2010 2:23 pm

Re: Request for an action function on the Manage Plugins page

Post by mmestnik »

About dos2unix. DOS has two bytes for each line ending and another byte for the end of each page(about 25lines depending) and one more byte at the end of file, where UNIX is smart and only uses a single byte to indicate the end of the line and nothing at the end of pages or the file. UNIX is never going to use two bytes, so Windows and DOS might as well join the 22nd century already and make the switch.

Typewrites have two actions at the end of a line, you move this big mettle thing from the right side to the left(the carriage return CR). Then you(I'm not sure if the order matters, I am sure for DOS it does) hit the key where the enter key is now(the line feed LF) and the paper moves forward(up) just a bit. Unix only uses the enter key LF as the "New Line" command.

The ASCII/hex codes for these are as follows 0x0D CR, 0x0A LF, 0x0C FF(Form Feed used to load a new sheet of paper, also tosses the current one on the floor or neatly in a pile if there is space on your desk). DOS would put 0xFF at the end of each file... no idea why, it's not part of the ASCII spec AFAIK.

dos2unix replaces these and removes them, but obviously it will not function if the file is mildly corrupt. It would not be a good idea for Nagios XI to do this automatically.
Locked