Sponsored Content
Top Forums Programming Curl alternative for python code Post 302931776 by Corona688 on Thursday 15th of January 2015 11:04:11 AM
Old 01-15-2015
Also possible with wget.

Code:
wget "http://10.0.0.1:8000/monitor/" --post-data="username=testuser&access_token=c3NhbmthMDJjsd&region=test&role=guide&ipaddr=192.168.0.37&name=test-testhost-001&check=enable"

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Code conversion from JSP to PYTHON

Guys I need to convert a code from JSP (Java Tags are also there inside JSP) to PYTHON. I have OK kind of knowledge in PYTHON, but dont have a muck knowledge in JAVA/JSP. Any idea how to approach? Thanks in advance to all C Saha (1 Reply)
Discussion started by: csaha
1 Replies

2. Shell Programming and Scripting

python code...convert to ksh or sh

Helloo... I am not much familiar with python..I found this small script in python I even do not have python on my computer...can anyone help me out to convert this into ksh or sh.. PLEASE any help I will appreciate.. here is python code.. #!/usr/bin/env python import random # Get a... (3 Replies)
Discussion started by: amon
3 Replies

3. UNIX for Advanced & Expert Users

Finding alternative code

Hi Sir's I've the below piece of code has the following functionalities: 1) Read the "pcp" file and create Job related parameter file "$PARMFILE". $PARMFILE has below variables: AFTD2010 "FILE_TYPE_D=Y export FILE_TYPE_D" AFTD2010 "FILE_TYPE_I=N export FILE_TYPE_I" AFTD2010... (0 Replies)
Discussion started by: Lokesha
0 Replies

4. Shell Programming and Scripting

Help with Python Code Whitespace

Hello All, I have some python code that pulls together titles and displays them on web pages. Here is the section of code I am struggling with: #string to grab title titlePattern =r'''\s*(\(+\))?(?P<title>.*)''' #returns the title part of the subject line def getTitle... (0 Replies)
Discussion started by: jhampt
0 Replies

5. Shell Programming and Scripting

Grabbin a html code from a page (Var = Curl)

Hi there. Im not very good on shell yet. This line, will print me YES or NO in console. Its the HTML code returned from the website, simply YES or NO curl -L "http://www.thewebsite.net/auth/log.jsp?user=$user&sessionId=$sid&serverId=$hash" How could i save this into a variable, so i... (1 Reply)
Discussion started by: Ziden
1 Replies

6. Post Here to Contact Site Administrators and Moderators

Alternative button for code tags

I am aware of the many issues surrounding posters not using code tags around code or data. Could we somewhat alleviate this issue by having a better icon that shows more clearly its function? (37 Replies)
Discussion started by: figaro
37 Replies

7. Shell Programming and Scripting

Alternative command/method to curl

is there a different way to do the following: curl -k -H "Content-Type:application/json" -X POST -d'{"api_token": "33blah526c-6bla71-441b-491b-0blahca08"}' https://10.10.10.10/api/1.4/auth/session -c /tmp/myhost01.myhost.com im seeking to use a different method because i'm running into TLS... (1 Reply)
Discussion started by: SkySmart
1 Replies

8. Shell Programming and Scripting

Simple Python Code Question

I have the following code: #!/usr/bin/env python mylist = def printWithoutNewlines(): for objects in mylist: #print(objects) objects = objects.replace('hello', "hi") print objects When executed, it gives the following output: ## ./loop.py hi... (3 Replies)
Discussion started by: SkySmart
3 Replies

9. Programming

Two problems with my python code

Hello everyone , I need your help to end my python code. I've this code in python : from ipywidgets import interact, Dropdown from ipywidgets import * from ipywidgets.embed import embed_minimal_html import pandas as pd import os import sys #################### Dropdown servers... (1 Reply)
Discussion started by: Tim2424
1 Replies
OCF_HEARTBEAT_NGINX(7)						OCF resource agents					    OCF_HEARTBEAT_NGINX(7)

NAME
ocf_heartbeat_nginx - Manages an Nginx web/proxy server instance SYNOPSIS
nginx [start | stop | status | monitor | meta-data | validate-all] DESCRIPTION
This is the resource agent for the Nginx web/proxy server. This resource agent does not monitor POP or IMAP servers, as we don't know how to determine meaningful status for them. The start operation ends with a loop in which monitor is repeatedly called to make sure that the server started and that it is operational. Hence, if the monitor operation does not succeed within the start operation timeout, the nginx resource will end with an error status. The default monitor operation will verify that nginx is running. The level 10 monitor operation by default will try and fetch the /nginx_status page - which is commented out in sample nginx configurations. Make sure that the /nginx_status page works and that the access is restricted to localhost (address 127.0.0.1) plus whatever places _outside the cluster_ you want to monitor the server from. See the status10url and status10regex attributes for more details. The level 20 monitor operation will perform a more complex set of tests from a configuration file. The level 30 monitor operation will run an external command to perform an arbitrary monitoring operation. SUPPORTED PARAMETERS
configfile The full pathname of the Nginx configuration file. This file is parsed to provide defaults for various other resource agent parameters. (unique, optional, string, no default) httpd The full pathname of the httpd binary (optional). (optional, string, default /usr/sbin/httpd) port A port number that we can probe for status information using the statusurl. This will default to the port number found in the configuration file, or 80, if none can be found in the configuration file. .sp (optional, integer, no default) status10url The URL to monitor (the nginx server status page by default) when given a level 10 monitor operation. If left unspecified, it will be inferred from the nginx configuration file, or defaulted to /nginx_status. .sp If you set this, make sure that it succeeds *only* from the localhost (127.0.0.1) and no other cluster nodes. Otherwise, the cluster software may complain about it being active on multiple nodes. (optional, string, no default) status10regex Regular expression to match in the output of status10url. Case insensitive. (optional, string, default Reading: [0-9]+ Writing: [0-9]+ Waiting: [0-9]+) testclient Client to use to query to Nginx for level 10 and level 20 tests. If not specified, the RA will try to find one on the system. Currently, wget and curl are supported, with curl being preferred. For example, you can set this parameter to "wget" if you prefer that to curl. (optional, string, no default) testurl URL to test. If it does not start with "http", then it's considered to be relative to the document root address. (optional, string, no default) test20regex Regular expression to match in the output of testurl. Case insensitive. (optional, string, no default) testconffile A file which contains a more complex test configuration. Could be useful if you have to check more than one web application or in case sensitive info should be passed as arguments (passwords). Furthermore, using a config file is the only way to specify certain parameters. .sp Please see README.webapps for examples and file description. (optional, string, no default) test20name Name of the test within the test configuration file. (optional, string, no default) external_monitor30_cmd Command string to run which implements level 30 monitoring. (optional, string, no default) options Extra options to apply when starting nginx. (optional, string, no default) SUPPORTED ACTIONS
This resource agent supports the following actions (operations): start Starts the resource. Suggested minimum timeout: 40s. stop Stops the resource. Suggested minimum timeout: 60s. reload Suggested minimum timeout: 40s. status Performs a status check. Suggested minimum timeout: 30s. monitor Performs a detailed status check. Suggested minimum timeout: 30s. Suggested interval: 10s. monitor Performs a detailed status check. Suggested minimum timeout: 30s. Suggested interval: 30s. monitor Performs a detailed status check. Suggested minimum timeout: 45s. monitor Performs a detailed status check. Suggested minimum timeout: 60s. meta-data Retrieves resource agent metadata (internal use only). Suggested minimum timeout: 5. validate-all Performs a validation of the resource configuration. Suggested minimum timeout: 5. EXAMPLE
The following is an example configuration for a nginx resource using the crm(8) shell: primitive p_nginx ocf:heartbeat:nginx op monitor timeout="30s" depth="0" interval="10s" op monitor timeout="30s" depth="10" interval="30s" op monitor timeout="45s" depth="20" op monitor timeout="60s" depth="30" SEE ALSO
http://www.linux-ha.org/wiki/nginx_(resource_agent) AUTHOR
Linux-HA contributors (see the resource agent source for information about individual authors) resource-agents UNKNOWN 03/09/2014 OCF_HEARTBEAT_NGINX(7)
All times are GMT -4. The time now is 10:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy