This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
post_to_url('/grid3/ack.php',{Tm:'%Tm%',Host:'%Host%',Monitor:'%Monitor%',Status:'%Status%',Event:'%Event%'}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}, |