[Check_mk (english)] check_mk commands.py...adding non-nagios commands? Or better off using custom host/service notes?

Jason Humes JHumes at acs.on.ca
Tue Apr 10 21:09:44 CEST 2012


Paste all this in as a host note to see where I'm going with this...if you try it as it...you'll get some empty variables like $HOSTALIAS$ and $HOSTGROUP$ as I'm working out how to add more variables to the custom notes area...cheers.

<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.js">
/***********************************************
* Animated Collapsible DIV v2.4- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/
</script>
<script type="text/javascript">
animatedcollapse.addDiv('helpdesk', 'fade=1')

animatedcollapse.ontoggle=function($, divobj, state){ //fires each time a DIV is expanded/contracted
        //$: Access to jQuery
        //divobj: DOM reference to DIV being expanded/ collapsed. Use "divobj.id" to get its ID
        //state: "block" or "none", depending on state
}
animatedcollapse.init()
</script>
</head>
<body>

<hr style="margin: 1em 0" />
<b><a href="javascript:animatedcollapse.toggle('zendesk')">Helpdesk Ticket Entry</a></b><br />
<div id="helpdesk" style="width: 800px; background: transparent; display:none">
<form action="">
Ticket Type: <select name="tickettype">
        <option value="Problem">Problem</option>
        <option value="Question">Question</option>
        <option value="Incident">Incident</option>
        <option value="Task">Task</option>
</select>           
Ticket Priority: <select name="ticketpriority">
        <option value="Low">Low</option>
        <option value="Normal">Normal</option>
        <option value="High">High</option>
        <option value="Urgent">Urgent</option>
</select><br />
Ticket Subject: <input type="text" name="ticketsubject" value="Check_MKDEV - $HOSTNAME$ - "style="width:896px;"/><br />
Ticket Body: <textarea name="ticketbody" rows="10" cols="126"/>https://1.1.1.1/check_mkdev/check_mk/view.py?view_name=hoststatus&site=&host=$HOSTNAME$ $HOSTALIAS$ $HOSTGROUP$</textarea><br />
<input type="submit" value="Enter Ticket" />
</form>
</div>
<hr style="margin: 1em 0" />
</body>
</html>



-----Original Message-----
From: Lander, Scott [mailto:slander at hearstsc.com] 
Sent: Tuesday, April 10, 2012 2:50 PM
To: Jason Humes
Subject: RE: [Check_mk (english)] check_mk commands.py...adding non-nagios commands? Or better off using custom host/service notes?

Note, and ajax code?

So I've created a custom notes that uses some ajax to expand an entry box when the user clicks a "Enter Helpdesk Ticket" button...it keeps the interface tight/easy to view and allows for passing check



-----Original Message-----
From: Jason Humes [mailto:JHumes at acs.on.ca]
Sent: Tuesday, April 10, 2012 2:47 PM
To: Lander, Scott
Subject: RE: [Check_mk (english)] check_mk commands.py...adding non-nagios commands? Or better off using custom host/service notes?

Sure, which part were you looking for?

Cheers

J

-----Original Message-----
From: Lander, Scott [mailto:slander at hearstsc.com]
Sent: Tuesday, April 10, 2012 2:27 PM
To: Jason Humes
Subject: RE: [Check_mk (english)] check_mk commands.py...adding non-nagios commands? Or better off using custom host/service notes?

Hi Jason,

   Care to share some of your code?  I have been thinking about doing something here very similar, and just haven't managed to get to it yet!

Scott


-----Original Message-----
From: checkmk-en-bounces at lists.mathias-kettner.de [mailto:checkmk-en-bounces at lists.mathias-kettner.de] On Behalf Of Jason Humes
Sent: Tuesday, April 10, 2012 10:37 AM
To: sven.kieske at compact.de; checkmk-en at lists.mathias-kettner.de
Subject: Re: [Check_mk (english)] check_mk commands.py...adding non-nagios commands? Or better off using custom host/service notes?

Looks like entering non-nagios commands into the commands.py doesn't work...So I've created a custom notes that uses some ajax to expand an entry box when the user clicks a "Enter Helpdesk Ticket" button...it keeps the interface tight/easy to view and allows for passing check_mk variables plus user entered text into our ticket system.

Thanks

J

-----Original Message-----
From: Jason Humes
Sent: Tuesday, April 10, 2012 9:58 AM
To: 'sven.kieske at compact.de'; checkmk-en at lists.mathias-kettner.de
Subject: RE: [Check_mk (english)] check_mk commands.py...adding non-nagios commands? Or better off using custom host/service notes?

Because that doesn't meet our specific needs.  In order for tickets to get created they need to be built with certain tags/fields and I'd like to add some more options such as setting the ticket severity, type, etc.

-----Original Message-----
From: checkmk-en-bounces at lists.mathias-kettner.de [mailto:checkmk-en-bounces at lists.mathias-kettner.de] On Behalf Of sven.kieske at compact.de
Sent: Tuesday, April 10, 2012 9:45 AM
To: checkmk-en at lists.mathias-kettner.de
Subject: Re: [Check_mk (english)] check_mk commands.py...adding non-nagios commands? Or better off using custom host/service notes?

Am 10.04.2012 15:41, schrieb JHumes at acs.on.ca:
> Hi
> I'd like to add a link for submitting a ticket to our helpdesk and 
> allow the user to enter some text while doing so.  It seems that the 
> "Commands" dropdown menu would be the best place for this to live and 
> I've found the code is in commands.py...I'm just wondering if I can 
> enter something other than NAGIOS commands into the command field?  So 
> instead of something like;
>
> command = "SEND_CUSTOM_%s_NOTIFICATION;%s;%s;%s;%s" % \
>                  ( cmdtag, spec, broadcast + forced, config.user_id,
> comment)
>
> It would have;
>
> command = "mail -s helpdeskhost.com ;%s;%s;%s;%s" % \
>                  ( cmdtag, spec, broadcast + forced, config.user_id,
> comment)
>
Why don't you just send this via the first command, as an notification-e-mail to your helpdesk? no need for an additional command?


--
kind regards

Sven Kieske

CompAct GmbH
Stralsunder Straße 62
33605 Bielefeld

Telefon: +49 521 2998222
Telefax: +49 521 2603198

_______________________________________________
checkmk-en mailing list
checkmk-en at lists.mathias-kettner.de
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en
------------------------------------------------------------------------------------
This e-mail message is intended only for the personal use of the recipient(s) named above. If you are not an intended recipient, you may not review, copy or distribute this message. If you have received this communication in error, please notify the Hearst Service Center (cadmin at hearstsc.com) immediately by email and delete the original message.
------------------------------------------------------------------------------------

------------------------------------------------------------------------------------
This e-mail message is intended only for the personal use of the recipient(s) named above. If you are not an intended recipient, you may not review, copy or distribute this message. If you have received this communication in error, please notify the Hearst Service Center (cadmin at hearstsc.com) immediately by email and delete the original message.
------------------------------------------------------------------------------------



More information about the checkmk-en mailing list