Skip to content

Instantly share code, notes, and snippets.

var postdata; //used to get the data wanted from d3.xhr() below
function testResults (form) {
var TestVar1 = form.value1.value;
var TestVar2 = form.value2.value;
var TestVar3 = form.value3.value;
// var TestVar4 = form.value4.value;
postdata = "data1=" + TestVar1 + "&data2=" + TestVar2 + "&data3=" + TestVar3;
// Set the dimensions of the canvas/graph - made it smaller for testing
var margin = {top: 15, right: 20, bottom: 50, left: 50},
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" -->
<head>
<meta name="viewport" content="width=device-width">
<script type="text/javascript" src="d3.min.js" charset="utf-8"></script>
<script src="datetimepicker_css.js">
/**************************************************************************
*Copyright (c) 2010-2014, Teng-Yong Ng . All rights reserved.
*http://www.rainforestnet.com/datetimepicker/datetimepicker.htm
***************************************************************************/
</script>
<?php
# Get parameters from caller and generate results
$data1 = $_POST['data1'];
$data2 = $_POST['data2'];
$data3 = $_POST['data3'];
# Log some details
$tracefile=fopen("/tmp/D3A.log","a");
echo fputs($tracefile,"D3A = : " . $data1 . "\n");
echo fputs($tracefile,"D3A = : " . $data2 . "\n");
echo fputs($tracefile,"D3A = : " . $data3 . "\n");
@canoedf
canoedf / return_using_javascript
Created March 17, 2014 13:30
Returning_from_calling_post_to_url
<?php
# . . . do some work then
# clear the screen with a little javascript
echo "<script type='text/javascript'>\n";
echo "document.body.innerHTML = ''";
echo "</script>";
# back to the initial screen which will refresh with a little javascript
echo "<script type='text/javascript'>\n";
echo "window.location.href = 'http://FQDN/ex8.php'";
echo "</script>";
@canoedf
canoedf / calling_post_to_url
Created March 17, 2014 13:22
Calling a 2nd page with php/javascript from php/javascript
post_to_url('/grid3/ack.php',{Tm:'%Tm%',Host:'%Host%',Monitor:'%Monitor%',Status:'%Status%',Event:'%Event%'})
check_cron.json
{
"checks": {
"cron_check": {
"handlers": ["osticket","pagerduty","smarts"],
"command": "/etc/sensu/plugins/check-procs.rb -p cron -C 1 ",
"interval": 60,
"incident_key": "cron_check",
"subscribers": [ "webservers" ]
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
</head>
<body>
<?php
# This will process incidents coming from Icinga storing in a table
$string = file_get_contents("php://input");
$result = (json_decode($string,true));
# Log some details
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
</head>
<body>
<?php
# This will process incidents coming from Logicmonitor storing in a database table
# The table can drive a standalone monitoring console without the overhead of the LM UI
# ----------------------------------------------------------------------------------------
$string = file_get_contents("php://input");
@canoedf
canoedf / LM_osTicket.php
Last active August 29, 2015 13:56
Logicmonitor to osTicket interface
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
</head>
<body>
<?php
# Logicmonitor to osTicket interface
# by Dan Fischer March 1, 2014
#
$string = file_get_contents("php://input");
/etc/sensu/handlers/osticket.rb
#!/usr/bin/env ruby
#
# This handler will create tickets in osTicket
#
# Note :- Adjust the API key and url in osTicket.json to match your osTicket API
#
# Author: Dan Fischer <noSPAM4me@yahoo.com>
#
# Released under the same terms as Sensu (the MIT license); see LICENSE