-
Notifications
You must be signed in to change notification settings - Fork 15
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
Match agent version to running server (install_bigfix) #11
Comments
Whoops. I didn't attach this to the file. Will reopen. |
Reopening as I apparently misunderstand github. Affected Files: |
Is this version available in the header returned by relays as well? I've never actually looked. This is not a bad idea, but there is absolutely no reason that the agent and server versions must match. Newer or older is generally fine. I typically install the newest version available to new clients, even if I have no plans to upgrade the server version in the near future. |
The relay install fixlets only apply for the agent version that matches the running server. Ergo, if you intend the machine to be a relay (as I am building in a kickstart), matching the server version is valuable. |
I just checked one of my relays, and the header is there as well. |
This is a good point about relays. Technically client versions don't have to match the relays or the servers, and that should include relays themselves, but it does make sense that the relay itself should have the same version client as it has relay. Are you going to make your code public? I have been thinking of making a relay kickstart script like this client one, which would probably incorporate this client install code as well. The idea would be to provide the parent relay as the location for the masthead file, and it would then install the client and relay on the system, with the parent relay set as the primary relay automatically. Actually, if you are making a relay kickstart, then you would just set the version variable to the version from the header and it would just do its thing automatically. The relay kickstart shouldn't run this code, it would incorporate it so you would only need 1 script instead of 2. |
Putting stuff here while I noodle on this:
|
My adaptation is below. This adds/changes:
Start/end the replace with the first and last lines, inclusive.
|
Reference for the switch splitting:
|
That doesn't appear to be the correct reference for switch splitting. I was just going to ask if you had references for some of this, in particular the switch stuff. The bummer about the lack of git history for this is that I can't see all the steps... where you started, what you tried, and how you eventually got there. This is an important part of being able to understand this stuff. It is very useful that most of the complexity added is at the top of the file. |
Correct link:
|
One problem with this proposed change is that it makes FQDN required, which I don't intend it to be if a masthead file is provided instead. It would also be nice if the default argument was FQDN so it didn't have to be specified in a special way using the I actually intend this script to have a default argument that is either the FQDN or a masthead file. If you give the default/unswitched argument to the script, then it will check if it is a file path by checking if the file exists. If so, it will assume it is the masthead file and use it as such... Otherwise it will assume it is a FQDN and it will attempt to download the masthead from it. I also intend the switch to be used without any arguments provided at all by including a masthead file in the same directory as the script. Obviously not all of this functionality has been included yet. You can already provide a I do like the |
I thought this was an easy way to integrate what I desired without overly impacting the existing work. I also generally prefer strict inputs over implicit behavior, so I went this way. |
I tend to prefer implicit behavior but with a way to change it through configuration. I tend to take the approach, how can I do the most with the least input. What you did is definitely easier than what I hope to do. The |
I just realized, I left some stray echo statements in there that I'd used for debugging. Editing... |
|
This seems interesting: http://stackoverflow.com/a/24501190/861745 |
Also, it seem like This would make the usage like the following items:
Having a masthead of actionsite file in the current working directory would always take precedence over all other options unless |
There is also the possibility of have a switch |
I just realized this code has curl hard coded within it to get the version of the parent relay, which will not work by default on all supported platforms because some only have wget, while some only have curl, while some have both. I really like the idea behind the It does seem like the |
My second edit changes -match to be boolean. I did consider the issue of hard-coding curl, but to properly handle the cases of detecting curl|wget and factor was more overhaul than I was looking for. ;) |
Poking around a bit, it appears that nc (nmap-ncat) is a great way to check for a remote open port. But, it's not something you can assume will be there. |
This bash one-liner looks like it'll work: |
|
I feel like the best way to check if it is valid is to just download the masthead, since that is what will be attempted anyway. It seems unnecessary to check to see if the domain is correct, then to later check that the masthead can be downloaded. This means changing up the order a bit. |
I suggest a -match option that explicitly installs the agent version that matches the running server. The server version is available in the HTTP Server header.
Server: BigFixHTTPServer/9.2.7.53
Affected Files:
The text was updated successfully, but these errors were encountered: