Discussion:
Curl commands
jhoffart
2013-10-21 19:59:43 UTC
Permalink
jhoffart [http://community.zenoss.org/people/jhoffart] created the discussion

"Curl commands"

To view the discussion, visit: http://community.zenoss.org/message/75018#75018

--------------------------------------------------------------
Hi,
     I am fairly new to zenoss and am having some trouble writing a curl command for zenoss. My instance of zenoss is based off of an older version that was in use before I came into the picture. The current command i have is


/usr/bin/curl --max-time 100 --retry 6 --retry-max-time 5 --retry-delay 5 --silent --trace-time --trace-ascii /heartbeat/bond `date "+%Y%m%d%H%M%S"`.txt http://192.168.179.199/heartbeat http://192.168.179.199/heartbeat

evertime i run it i get the following error:

16:06:44.369652 == Info: getaddrinfo(3) failed for +%Y%m%d%H%M%S`.txt:80 
16:06:44.369717 == Info: Couldn't resolve host '+%Y%m%d%H%M%S`.txt' 

here is the full output for the command:

/usr/bin/curl --max-time 100 --retry 6 --retry-max-time 5 --retry-delay 5 --silent --trace-time --trace-ascii /heartbeat/bond `date "+%Y%m%d%H%M%S"`.txt http://192.168.179.199/heartbeat http://192.168.179.199/heartbeat 
16:06:44.258486 == Info: getaddrinfo(3) failed for `date:80 
16:06:44.258597 == Info: Couldn't resolve host '`date' 
16:06:44.258620 == Info: Closing connection #0 
16:06:44.369652 == Info: getaddrinfo(3) failed for +%Y%m%d%H%M%S`.txt:80 
16:06:44.369717 == Info: Couldn't resolve host '+%Y%m%d%H%M%S`.txt' 
16:06:44.369739 == Info: Closing connection #0 
16:06:44.369816 == Info: About to connect() to 192.168.179.199 port 80 (#0) 
16:06:44.369853 == Info:   Trying 192.168.179.199... 16:06:44.370224 == Info: connected 
16:06:44.370246 == Info: Connected to 192.168.179.199 (192.168.179.199) port 80 (#0) 
16:06:44.370290 => Send header, 179 bytes (0xb3) 
0000: GET /heartbeat HTTP/1.1 
0019: User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 
0059:  NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2 
008d: Host: 192.168.179.199 
00a4: Accept: */* 
00b1: 
16:06:44.495096 <= Recv header, 17 bytes (0x11) 
0000: HTTP/1.1 200 OK 
16:06:44.495154 <= Recv header, 37 bytes (0x25) 
0000: Date: Mon, 21 Oct 2013 19:57:32 GMT 
16:06:44.495183 <= Recv header, 94 bytes (0x5e) 


Any help on this would be appriciated.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/75018#75018]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Benjamin Schwarcz
2013-10-22 07:15:58 UTC
Permalink
Benjamin Schwarcz [http://community.zenoss.org/people/toxicgarden] created the discussion

"Re: Curl commands"

To view the discussion, visit: http://community.zenoss.org/message/75020#75020

--------------------------------------------------------------
what are you trying to do with this check?
If i run it from console, it tries to connect the the timestamped file.

[***@A7885 ~]# /usr/bin/curl --max-time 100 --retry 6 --retry-max-time 5 --retry-delay 5 --silent --trace-time --trace-ascii /heartbeat/bond `date "+%Y%m%d%H%M%S"`.txt http://192.168.179.199/heartbeat http://192.168.179.199/heartbeat
00:17:07.238562 == Info: getaddrinfo(3) failed for 20131022091420.txt:80
00:17:07.238758 == Info: Couldn't resolve host '20131022091420.txt'
00:17:07.238847 == Info: Closing connection #0
00:17:07.239026 == Info: About to connect() to 192.168.179.199 port 80 (#0)
00:17:07.239148 == Info:   Trying 192.168.179.199... ^C
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/75020#75020]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
jhoffart
2013-10-23 12:30:16 UTC
Permalink
jhoffart [http://community.zenoss.org/people/jhoffart] created the discussion

"Re: Curl commands"

To view the discussion, visit: http://community.zenoss.org/message/75044#75044

--------------------------------------------------------------
Thanks for the reply, and the command is supose to return the data that is displayed on that URL. However after further reveiw of the command me and a co worker have found that the command was outputting to a txt file. Guess thats what we get for trying to reuse code so we found out that if we cut out the --trace-time --trace-ascii /heartbeat/bond `date "+%Y%m%d%H%M%S"`.txt part of the code it then returns the values on the URL and output correctly to the graphs we have setup.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/75044#75044]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Loading...