Jump to content

Recommended Posts

I'm new to Automate/Scripting/SQL and I"m trying to get my monitor to give back results in the Status and History tabs, I've read a few post and I'm still a little unsure as to what I'm doing wrong.  I have a search that I converted to SQL have the table and field checks set to RAWSQL, and pasted the SQL statement from the search query into the Additional Conditions.  I get the query results I want but nothing in the status or history tabs?  I've seen post where I need to add additional conditions for it to read it correctly?  Here is my SQL statement, if anyone can let me know what I have wrong or what I need to add additionaly that would be great.  What I'm looking to do is for the monitor to fire off an email from an alert template and run an uninstall script if a EDF field is checked off and a particular piece of software is installed:

   computers.computerid as 'TestValue',
   computers.name as 'IdentityField',
   clients.name as `Client Name`,
   computers.domain as `Computer Domain`,
   computers.username as `Computer User`,
   IFNULL(IFNULL(edfAssigned1.Value,edfDefault1.value),'0') as `Computer - Extra Data Field - Comtech Automations - Ronnie - Do Not Install Auto Elevate`,
   Software.Name as `Computer.Applications.Name`
FROM Computers 
LEFT JOIN inv_operatingsystem ON (Computers.ComputerId=inv_operatingsystem.ComputerId)
LEFT JOIN Clients ON (Computers.ClientId=Clients.ClientId)
LEFT JOIN Locations ON (Computers.LocationId=Locations.LocationID)
LEFT JOIN ExtraFieldData edfAssigned1 ON (edfAssigned1.id=Computers.ComputerId and edfAssigned1.ExtraFieldId =(Select ExtraField.id FROM ExtraField WHERE LTGuid='ff936f3a-a841-4cf4-bc9e-3217fd3ca763'))
LEFT JOIN ExtraFieldData edfDefault1 ON (edfDefault1.id=0 and edfDefault1.ExtraFieldId =(Select ExtraField.id FROM ExtraField WHERE LTGuid='ff936f3a-a841-4cf4-bc9e-3217fd3ca763'))
LEFT JOIN Software ON (Software.ComputerId = Computers.ComputerId)
((((IFNULL(IFNULL(edfAssigned1.Value,edfDefault1.value),'0')<>0) AND (Software.Name = 'AutoElevate'))))

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...