moving a command to a different host template using icinga director - icinga2

I have Icinga2 installed with icingaweb2 on Ubuntu 19.10 and I have Icinga director Installed for the configuration which is really awesome.
I created some command and attached them to linux-agent host template.
that was a mistake cause I added more servers that don't need these new commands.
so I created a new host template called my-linux-agent as a duplicate of linux-agent and now I want to move all my custom commands to the new host template and I can't find any way to do that.
versions:
Icinga2: 2.10.5
IcingaWeb2: 2.7.1
thanks

so i couldn't find a way to move the command to a different host directly
but you can easily duplicate the command to a different host and remove the previous one using the following simple steps:
open the relevant command
click on duplicate to duplicate the command
choose the relevant host and click save
open the previous command and delete it

Related

kubectl not working on my windows 10 machine

When I try to run any kubectl command including kubectl version, I get a pop-up saying "This app can't run on your PC, To find a version for your PC, check with the software publisher" when this is closed, the terminal shows "access denied"
The weird thing is, when I run the "kubectl version" command in the directory where I have downloaded kubectl.exe, it works fine.
I have even added this path to my PATH variables.
thank you for the answer, #rally
apparently, in my machine, it was an issue of administrative rights during installation. My workplace's IT added the permission and it worked for me.
Adding this answer here so that if anyone else comes across this problem they can try this solution as well.
Not knowing what exactly you downloaded, i would suggest you to delete everying in the folder and follow the instructions for installing kubectl for Windows from here:
https://kubernetes.io/docs/tasks/tools/install-kubectl-windows/
Note: downloading the .exe is not enough. You need a kubeconfig file "config", which contains the configuration to access your cluster.
kubectl looks for this file in a hidden folder under your user profile directory. c:\users<me>.kube.
Just to let you try, i would suggest you to activate Kubernetes in your Docker-Desktop installation. I guess you have this installed. If not install it from the Dockersite. https://www.docker.com/products/docker-desktop/
Activating Kubernetes inside Docker-desktop, will install also kubectl and save the config in the .kube folder.
After the installation finished, in a new terminal:
kubectl get node
You should see the 1 node in the kubernetes-docker-desktop cluster.
Now if you want to access another cluster, you need the kubeconfig-file for that cluster. If you have it, just rename the config in the .kube folder (to not loose it) and put the other config inside.
If the new config file is correct you should be able to access that cluster.
The config file can be structured to hold more than one cluster configuration and you can switch between them using a so called context.
Here you can get the information how to do that, according to your needs:
https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/
Hope this can help you, starting with KUbernetes.

Homestead.test default file gives [No input file specified] Ubuntu

I just installed Ubuntu 17.10 and I want to try create a website using Laravel, but I hit a rock, I followed the instructions. step by step on the official website. But I think something is missing,
Because I haven't touch / edit anything in Homestead.yaml, so basically it would working right?
I already use vagrant up --provision. already create the ssh key. I already googled it and try several ways but it doesn't fix it, I already turn on my XAMPP as well
Sorry but I never touched Ubuntu before, so I'm very blind using this OS
Here is my Homestead.yaml file
Homestead.yaml
and the directories of /home/workspace/ and /home/workspace/Homestead/
~ Dir
Homestead Dir
my Hosts file
Hosts File
EDITED:
I just create a new project in ~/Homestead/Projects/[it goes here] because the default laravel installation is working already, so now I want to create a new project in Projects folder inside Homestead, but why it redirect the url to https?
The folders
in this screenshot: https://i.stack.imgur.com/4cxGy.png Your ~/code folder appears to not exist, which means Homestead will not map it. Create that folder in your Host OS (Ubuntu 17) and then run vagrant destroy && vagrant up If you still have issues post the entire output here for us to check.
For my last question, why when I tried to open my new projects is always giving me this error your internet connection is not private. it's because I'm using .app or .dev in the of the site name, the problem is from google chrome, so I need changed it to .test then it's working perfectly.
I got the answer from this site
https://laracasts.com/discuss/channels/laravel/chrome-blocked-localhost-with-error-your-connection-is-not-private

Docker - adding DNS by editing “docker” file

I am using Boot2Docker on Windows and I want to edit file /etc/init.d/docker. After editing it, saving using wq command and reboot command its state is not saved. What I am doing wrong? What I want to achieve is to add configurations with DNS like in attached screen (--bip and --dns):
Is this right place to do this configuration?
That seems expected, considering Boot2Docker is based on the TinyCore distro, which only persists some files in /var/lib/boot2docker/
Typically, I modify /var/lib/boot2docker/profile in order to:
change other files
or export (set) other environment variables
That script will be persisted across TinyCore sessions, and will be executed at each restart.

How to point a perforce workspace to a project that is synchronized across two machines?

I have an eclipse synchronized project where I do the work on my Windows machine and then synchronize and compile it on the linux build server. However, the Windows workspace is connected to perforce and the linux one is not. The problem is that when Eclipse synchronizes the two, the permissions get messed up on the linux side so that I cannot execute certain shell scripts that usually execute during the build. The workaround that I have would be to somehow chmod all the *.sh files before executing a build, but I would much rather have perforce know about both places (that way I could also commit from either the linux side or the windows side). For performance reasons, I couldn't run eclipse on the remote build server so this was the only solution I found. Also, when I tried setting up a second workspace for the linux side, it gave me errors saying "could not clobber X". I think the main problem is that I'm dealing with some sort of permissions issue here.
I may have found the answer. According to the perforce documentation:
By default, you can only use a workspace on the machine that is specified by the Host: field. If you want to use the same client workspace on multiple machines with different platforms, delete the Host: entry and set the AltRoots: field in the client specification. You can specify a maximum of two alternate client workspace roots. The locations must be visible from all machines that will be using them, for example through NFS or Samba mounts.
Perforce compares the current working directory against the main Root: first, and then against the two AltRoots: if specified. The first root to match the current working directory is used. If no roots match, the main root is used.
Note
If you are using a Windows directory in any of your client roots, specify the Windows directory as your main client Root: and specify your other workspace root directories in the AltRoots: field.
In the following example, if user bruno's current working directory is located under /usr/bruno, Perforce uses the UNIX path as his client workspace root, rather than c:\bruno_ws. This approach allows bruno to use the same client workspace specification for both UNIX and Windows development.
Client: bruno_ws
Owner: bruno
Description:
Created by bruno.
Root: c:\bruno_ws
AltRoots:
/usr/bruno/
To find out which workspace root is in effect, issue the p4 info command and check the Client root: field.
If you edit text files in the same workspace from different platforms, ensure that the editors and settings you use preserve the line endings. For details about line-endings in cross-platform settings, refer to the Perforce System Administrator's Guide.
You could have two workspaces, one for each machine. When you've done the work on the Windows machine, you could shelve the changes, and then unshelve them on the Linux machine and do the build there.
I did the following to set up alternate roots in Perforce:
Created a workspace in Windows
Set the current client (workspace) with "p4 set P4CLIENT=workspace_name", I used Windows+Cygwin to do this
Removed the "Host" from this client (workspace) "p4 client -o | grep -v Host: | p4 client -i" I used Windows+Cygwin to do this
In Linux added the alternate root in P4V, don't use ~, use the absolute path, I didn't test environment variables
Switched to the workspace in P4V
Got the latest revision in P4V, and checked the "Force" option
References:
http://answers.perforce.com/articles/KB/3412
Override host to null in perforce client creation
https://www.perforce.com/perforce/r12.1/manuals/cmdref/client.html
sqenixs's answer here

Installing Zend Framework After Xampp

I am running Windows 7 and am using Xampp. I would like to install the Zend framework for PHP, but I am having difficulties understanding how to install it. I have used the Zend framework before, but it was already installed on the Linux system I was working on.
I am reading through the Zend documentation here: http://framework.zend.com/manual/en/learning.quickstart.create-project.html
I am having trouble with updating the includes_path portion. My original include path was include_path = ".;C:\xampp\php\PEAR", but I updated it to include_path = ".;C:\Zend".
I then followed the directions for creating a new project by opening the command line tool and running % C:\Zend\bin\zf.sh create project testproject in the desired directory. I get the following error message: '%' is not recognized as an internal or external command, or a batch file.
Some help with this would be greatly appreciated.
C:\Zend\bin\zf.sh is for linux, you need C:\Zend\bin\zf.bat I dont even know how you could run it
To setup ZF you just need to add C:\Zend\library in your include_path
To fix PHP not found you need to add ;C:\xampp\php\ to the environment variable "Path" from
Click Start, Right Click on Computer then click Properties
Then Advanced System settings>Advanced Tab/Environment Variables>System variables>Path/Edit...
Then append to the end ;C:\xampp\php
You should also append ;C:\Zend\bin for easy access to zf.bat [2]
Then to create project do not use cd C:\Zend\bin!! because your project will be created into that directory. Use the full path C:\Zend\bin\zf create project quickstart
or if you did step [2], simply go to your htdocs (with cd your_htdocs_path) or whatever you set in apache for web root and execute zf create projext quickstart
you also might need to setup a virtual host "quickstart" in apache and probably new line in windows hosts file: 127.0.0.1 quickstart because ZF is designed mainly for virtual hosts
you can install the zend framework using PEAR
pear channel-discover zend.googlecode.com/svn
pear install zend/zend
If you don't know where is your PEAR executable, run a file search for "pear", or "pear.exe".
After that, check out the section called "Setting up the CLI tool on Windows" in http://framework.zend.com/manual/en/zend.tool.framework.clitool.html. It will help you set up a easy access to the zf command line tool.
You can also go to your zendFrame work where you have extracted it and then go to bin folder (in my case “C:\xampp\htdocs\ZendFramework\bin”) where you can find zf.bat .
Edit it with any editer and go to
“SET PHP_BIN=php.exe ”
and set it to
“SET PHP_BIN=C:\xampp\php\php.exe”
and it worked for me…
Look's like your trying to run a shell script on cmd, not going to work, try this:
Start > Run > cmd [enter]
> cd C:\path\to\html\docs
> C:\Zend\bin\zf create project quickstart
and do not place the > marker, just the cd .. and zf ..
Add the path to the php interpreter to the %PATH% environment variable:
control panel => system => Advanced system settings => Environment Variables... => System Variables => => append ;C:\xampp\php

Resources