Nagios has detected a problem with this service ( State: UNK

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
lazoo
Posts: 22
Joined: Tue Jul 25, 2017 2:25 pm

Nagios has detected a problem with this service ( State: UNK

Post by lazoo »

I need to modify this command by replacing ( " to ' )on all the interface at once,


before the change

check_xi_service_ifoperstatusnag!369099151!-v3 -u IT-SNMPv3User -A "$Password#" -x AES -X "Password" -a MD5 -l authPriv

after the change
check_xi_service_ifoperstatusnag!369099151!-v3 -u IT-SNMPv3User -A '$Password#' -x AES -X 'Password' -a MD5 -l authPriv


I want to be able to change that on all interfaces one time.is that possible?
bolson

Re: Nagios has detected a problem with this service ( State:

Post by bolson »

Hello lazoo,

You could write a script around this command:

Code: Select all

sed -i "s/\"/'/g" *


The command will replace all instances of " with ' in the current directory.
lazoo
Posts: 22
Joined: Tue Jul 25, 2017 2:25 pm

Re: Nagios has detected a problem with this service ( State:

Post by lazoo »

I need to apply these changes using bulk tools for all interfaces on the switch
I need help I'm new with Nagios.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Nagios has detected a problem with this service ( State:

Post by dwhitfield »

If all your hosts are using the same service, then you only need to change it once.

Can you PM me your Profile so that we can see a bit more about your setup? You can download it by going to Admin > System Config > System Profile and click the ***Download Profile*** button towards the top. If for whatever reason you *cannot* download the profile, please put the output of View System Info (5.3.4+, Show Profile if older) in the thread (that will at least get us some info). This will give us access to many of the logs we would otherwise ask for individually. If security is a concern, you can unzip the profile take out what you like, and then zip it up again. We may end up needing something you remove, but we can ask for that specifically.

After you PM the profile, please update this thread. Updating this thread is the only way for it to show back up on our dashboard.
lazoo
Posts: 22
Joined: Tue Jul 25, 2017 2:25 pm

Re: Nagios has detected a problem with this service ( State:

Post by lazoo »

Please check the attached file.
You do not have the required permissions to view the files attached to this post.
lazoo
Posts: 22
Joined: Tue Jul 25, 2017 2:25 pm

Re: Nagios has detected a problem with this service ( State:

Post by lazoo »

Also, when I receive an email notification its showing port number 34566 for example, instead of the Interface number, I want to receive email showing the interfaces that having problems.
You do not have the required permissions to view the files attached to this post.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Nagios has detected a problem with this service ( State:

Post by dwhitfield »

The easiest way is going to be to rerun the wizard. That part of the email is being generated from $SERVICEDESC$ so if you want to change that, you need to change the service description.
lazoo
Posts: 22
Joined: Tue Jul 25, 2017 2:25 pm

Re: Nagios has detected a problem with this service ( State:

Post by lazoo »

What should I put into $ARG1$ this will represent interfaces?
You do not have the required permissions to view the files attached to this post.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Nagios has detected a problem with this service ( State:

Post by dwhitfield »

That is not where you change the email. The email command is as follows: /usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$

As I mentioned before, you will need to change the Service Description (or the email command). Changing the check command will not change the output of the email in the way you want.
lazoo
Posts: 22
Joined: Tue Jul 25, 2017 2:25 pm

Re: Nagios has detected a problem with this service ( State:

Post by lazoo »

I got the email part , I'm talking about applying changes on all interfaces on one host . I'm having an Issue status unknown so the only way to fix this issue is to replace " to " on every single interface.
check_xi_service_ifoperstatusnag!369098781!-v3 -u IT-SNMPv3User -A "$password#" -x AES -X "$password#" -a MD5 -l authPriv

check_xi_service_ifoperstatusnag!369098781!-v3 -u IT-SNMPv3User -A '$password#' -x AES -X '$password#' -a MD5 -l authPriv



I want to use bulk tools to change that on all interfaces.
Locked