Posts

bash - how to create multi user paramerter in zabbix from a script -

this shell script return 2 values 1 packet loss percentage , true or false : server_ip=$1 checkip=`ping -c 2 -w 2 $server_ip | grep "packet loss" | cut -d " " -f 6 | cut -d "%" -f1` test1=$? echo $checkip if [ $test1 -eq 0 ]; echo "1" else echo "0" fi in zabbix when create item enter 1 parameter value have 2 values 1 packet loss , second ping result (0 , 1) how can create 2 items 1 packet lost percentage , second ping health check script? dont want create 1 thanks andre try script guide want : #!/bin/bash case $1 in packetloss) ping -c2 -w1 -q 8.8.8.8 | grep -op '\d+(?=% packet loss)' ;; timeout) ping -c2 -q 8.8.8.8 | grep 'time' | awk -f',' '{ print$4}' | awk '{print $2}' | cut -c 1-4 ;; *) echo "use: packetloss , timeout";; esac try (im in zsh): zabbix_agentd -t ping.loss\[timeout\] ping.loss[timeout] ...

datetime Problems in Python IDLE -

i have weird problem. have 2 python 3.4.3 installations - 1 on windows xp, other on windows 7 x64. only 1 on winxp exhibits these problems: when open python idle shell, can execute dir(datetime) before import , print attributes (but list shorter on windows 7, after importing datetime ). the following fails in idle, because attribute now not found: import datetime datetime.datetime.now() the regular python command prompt works fine. it seem idle has version of datetime imported, differs standard datetime module. unfortunately, not have access xp machine right now, can't run tests right now. same problems present on windows 7 machine, aren't.

ssh - How to do X11 forwarding to a virtual machine running on a remote linux host? -

i running virtual machine on remote linux host: my machine -> linux host -> virtual machine running on linux host i have x11 forwarding enabled on linux host, , on virtual machine. trying run jvisualvm on virtual machine on own machine launched using ssh command (with ssh -x). the ssh command i'm using is: ssh -x -t root@linux_host -l 29998:localhost:29999 ssh -x -t -i /root/.ssh/my_key user@virtual_machine -l 29999:localhost:9999 once i'm connected set display variable with: display=<my machine's ip address>:0.0 then run jvisualvm this, expecting window open on own machine: /usr/java/jdk1.7.0_95/bin/jvisualvm -cp:a /opt/jboss/bin/client/jboss-cli-client.jar --jdkhome /usr/java/jdk1.7.0_95/ but either error display not set, or jvisual exits after few seconds error code of 2. since you're using ssh -x you're apparently expecting use secure x forwarding ssh. in case, ssh sould set display variable , should not override set...

android - App-server communication protocol -

i'm building little android app connect server. my app use simple post send message server, , i'm using google cloud messaging server send message app. i built registration page, email confirmation , connection page wonder how lock communication between server , app. this protocol have in mind ( let's take simple exemple of app app message) : app send post infos server self infos (like name , auth_token), destination user , message server search apps belong destination user , use curl forward message gcm gcm send message destination apps how can server sure name, auth_token etc server receive sender ? let server generate authentication token when client doing registration , send client. server knows [client - token] mapping. every time client wants send message, sends authentication token server can , check. client not have send or name, server should know this. to prevent mitm attacks, use secure connection (https).

c# - cmd process won't execute correct command -

i'm working on project "send" command cmd.exe , receive output. command need file path -k , url. have following code (names , values changed): string path = "c:\users\program.exe" string pathcustom = "\"" + path + "\""; //the path needs in quotation marks process p = new process(); p.startinfo.filename = "cmd.exe"; p.startinfo.useshellexecute = false; string address = "1.2.3" string command = pathcustom + " " + "-k" + " " + "https://username:passwort@serveradress" + address; //serveradress url p.startinfo.arguments = "/c " + command; p.startinfo.redirectstandardoutput = true; p.start(); string returnvalue = p.standardoutput.readtoend(); this code working fine want be, need methode thats similar except address looks different. in code above 1.2.3 int following method address has (including...

listview - How to get transparent list view in javafx? -

i have list view. want make cells background transparent. currently, doing following: .list-cell { -fx-background-color: transparent; } but, color of cells remain white. have tried same other colors. works other colors. but, it's not working transparent color. how can transparent list-view? you have make both list-view , list-cell transparent. .list-cell { -fx-background-color: transparent; } .list-view { -fx-background-color: transparent; }

ASP.NET 5.0 beta 8 in Docker doesn't start -

i have been running website using asp.net 5.0 beta 7 in docker container, using official docker image - https://github.com/aspnet/aspnet-docker - working fine. i updated project beta 8, , changed dockerfile use beta 8 version of docker image. works fine when run locally on windows machine, whether use visual studio start project iis express, or run using kestrel. however, push dokku server, doesn't seem start properly. don't errors container output, have checks file dokku uses ensure web server has started, , fails (indicating hasn't started properly, or not listening should be). tried removing checks , cannot connect either - bad gateway message nginx. i don't know why happening, because when push dokku, following response: ... remote: [1g-----> attempt 5/5 waiting 10 seconds ...[k remote: [1g checks expected result:[k remote: [1g http://localhost/ => "my website"[k remote: not start due 1 failed checks.[k remote: [1g ! [k r...