Tag Info

New answers tagged

2

It's really simple as you describe it: for k in {50..99}; do echo ip dhcp-relay 10.32.1$k.129 10.32.$k.1 enable; done > pastethisinswitch.txt but it will only scale up to 99 that way. You can scale it up to 254 like so: for k in {50..154}; do echo ip dhcp-relay 10.32.$(expr 100 + $k).129 10.32.$k.1 enable; done > pastethisinswitch.txt Your ...


3

Move your pictures out of /usr/lib//cgi-bin/ folder and put them somewhere within /var/www/ Update your paths accordingly. Every time you trying to access any file within cgi-bin path it is expecting that content will be generated by executing that file.


3

You'd use netdom. Assuming you don't want to give yourself carpal tunnel... and the most boring day ever. If you had a text file with all the computer names in it, (one per line) you could whip up a batch script like the below to do it all at once. FOR /f %%i in (C:\mylistofcomputers.txt) DO (netdom join /d:mydomain.tld ...


1

To flee of EnableDelayedExpansion you could try next approach with a procedure call: @ECHO OFF >NUL setlocal SET "VBoxManage=C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" SET /A "P=25553" FOR /L %%M IN (1,1,5) Do call :treat %%M ECHO All cloning finished. pause endlocal goto :eof :treat rem next two operational commands are ECHO-ed for debugging ...


3

I think you just need to review the FOR /? help a bit. You've mixed a couple different things together which won't work. The cmd interpreter is limited compared to other scripting environments you may be familiar with. I think all you're asking is "How do I use FOR in a batch file to count from 1 to 5 in increments of 1?" And that's simple enough: FOR /L ...


1

I found the problem... there was an extra space in the .yaml file which caused the error. Thanks for your help.


1

Thanks Keith. I got it fixed. Just added double quotes to the URL and that did the job :) curl -o test/test2 -u user:password "http://10.0.0.1/icinga/cgi-bin/status.cgi/host=10.0.0.2&csvoutput"


1

Icinga natively supports JSON output in status.cgi. By constructing the right filter arguments, you can get JSON of anything that status.cgi can display. For example, something like: status.cgi?hoststatustypes=3&serviceprops=2097162&servicestatustypes=20&jsonoutput


0

Apparently Icinga2 has a feature called "Livestatus" which allows the user to send extcommands (http://docs.icinga.org/latest/en/extcommands2.html) through a TCP connection. All you need to do is prefix the command with COMMAND.


0

I'd use facter for that. yum install facter facter ipaddress facter ipaddress_eth0


8

Here are ways to get your Linux machine IP address: /sbin/ifconfig If you know the name of your Network Interface card, you can specify it in the command and get the results for that specific NIC: /sbin/ifconfig eth0 Another command is: /sbin/ip addr If you know the name of your Network Interface card, you can specify it in the command and get the ...


2

Typically that is called monitoring and is something you don't do from the server itself (dead servers have typically great difficulty announcing their own deaths) but from second host. Many monitoring systems have agents that can be installed on the servers that are being monitored and which can be called to attempt a service restart automatically as ...


2

cat domain.txt | rev | sort | rev


1

/bin/su - ftp -s /bin/sh -c "/usr/bin/env mkdir /home/ftp/$PAM_USER" Means run the following command /usr/bin/env mkdir /home/ftp/$PAM_USER As the ftp user. You'd need to be root to run the command. /bin/su will change to a new user ftp and that user is running the command via -c using a /bin/sh shell as referenced by -s



Top 50 recent answers are included