I have a check that logs into an email account and retrieves mail. Based on the content of the email it could be one of 2 services. Both emails could be in the mailbox at the same time so I don't know if the mail will be for a particular service until I parse it. After the mail is checked it is moved to a backup folder in the mailbox. I don't think I can have a check script for each service to check the mailbox without missing an email that needs to be parsed since all mail is pulled when script logs in to the email account.
Is it possible to write a local check script that could send its output to multiple services?
NagiosXI Local check script
Re: NagiosXI Local check script
You should be able to have a script that will pull the mail, parse, and then send the results to multiple passive XI services using NRDP.
Submitting results to NRDP can be done with curl for example:
Where hostname and service name are the names of passive service checks you've put in place in the CCM or setup with the passive config wizard.
Submitting results to NRDP can be done with curl for example:
Code: Select all
curl -XPOST 1.2.3.4/nrdp/ -d 'cmd=submitcheck&token=NRDP_TOKEN&JSONDATA={
"checkresults": [
{
"checkresult": {
"type": "service",
"checktype": "1"
},
"hostname": "somehost",
"servicename": "someservice",
"state": "1",
"output": "WARNING: Danger Will Robinson! | perfdata=1;"
}
]
}
'As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
dslaughter
- Posts: 140
- Joined: Wed Feb 20, 2019 3:46 pm
Re: NagiosXI Local check script
I had considered that but since I was running local I wanted the option to force check. If you think passive is the best way to locally send to multiple services I will set it up for testing.
Unless you can think of any other way to accomplish this then go ahead and lock it.
Thanks!
Unless you can think of any other way to accomplish this then go ahead and lock it.
Thanks!
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: NagiosXI Local check script
Locking threaddslaughter wrote:I had considered that but since I was running local I wanted the option to force check. If you think passive is the best way to locally send to multiple services I will set it up for testing.
Unless you can think of any other way to accomplish this then go ahead and lock it.
Thanks!