Hi all
I have problem figure out to use multiple ports status in on service. Im using check_ifoperstatus but i have 48 ports on the switch. In order to monitor all of this ports i have to create separate service like "define service {bla bla}". But I'm sure that this can be done in one Service to define all ports. But I can't figure out how.
I'v try using the command like this
"check_command check_ifoperstatus! -U $ARG1$ -A $ARG2$ -X $ARG3$ -L $ARG4$ -k 1, -k 2, -k 3"
where "-k 1" is the first port "-k 2" is the second etc. ...
But no success.
Some hints about this ?
Multiple ports in one service
Re: Multiple ports in one service
What is your goal?
Check all ports, if one is down get a critical notification?
Or is it just information on the port status?
Check all ports, if one is down get a critical notification?
Or is it just information on the port status?
Rob Hassing


Re: Multiple ports in one service
What is the difference ?Check all ports, if one is down get a critical notification?
Or is it just information on the port status?
The goal is not have big config file, more simple one line not paragraphs to scroll down etc.
Re: Multiple ports in one service
The difference is that you might want to see what is going on a single port instead of the entire switch (or all ports of a switch).What is the difference ?
The goal is not have big config file, more simple one line not paragraphs to scroll down etc.
If you monitor 48 ports with one service check it is one alert/notification for all 48 ports.
If than a second port goes down and the service check is acknowledged it is still critical, but acknowledged.
I don't think it makes sense to monitor 48 ports in one service check.
If you would monitor all port seperately you could check if this one port is either up or down.
When one port is down and this service check is acknowledged and the second ports goes down, it kicks of a new alert/notification.
Rob Hassing


Re: Multiple ports in one service
OK This is more clear now.
So I would like to monitor all ports on a switch if one port goes down send critical about that one port. So now i have config file with "define service {bla bla}" and this is for one port ( port 1 ) ( port 2 will be again new "define service {bla bla}" ) etc.
The command i have use is check_ifoperstatus! -U $_HOSTUSER$ -A $_HOSTPASS$ -X $_HOSTPASS$ -L $_HOSTAUTH$ -k 2 --- this is for port 2 and i have new define service with "k 3" etc.
In order to monitor all ports on a switch separate i have to write a tones of same code with different one parameter " the k" one. And if i have lots of Switches, you get my point. So how can i repeat the same service for all ports, because i can repeat the same service for lot of host if i put the comma (,) after host_name. So my short question is can i do this with the check_command like this:
check_ifoperstatus! -U $_HOSTUSER$ -A $_HOSTPASS$ -X $_HOSTPASS$ -L $_HOSTAUTH$ -k 1, -k 2, -k 3 Same parameters for different ports k 1 port 1; k 2 for port 2 etc.
So I would like to monitor all ports on a switch if one port goes down send critical about that one port. So now i have config file with "define service {bla bla}" and this is for one port ( port 1 ) ( port 2 will be again new "define service {bla bla}" ) etc.
The command i have use is check_ifoperstatus! -U $_HOSTUSER$ -A $_HOSTPASS$ -X $_HOSTPASS$ -L $_HOSTAUTH$ -k 2 --- this is for port 2 and i have new define service with "k 3" etc.
In order to monitor all ports on a switch separate i have to write a tones of same code with different one parameter " the k" one. And if i have lots of Switches, you get my point. So how can i repeat the same service for all ports, because i can repeat the same service for lot of host if i put the comma (,) after host_name. So my short question is can i do this with the check_command like this:
check_ifoperstatus! -U $_HOSTUSER$ -A $_HOSTPASS$ -X $_HOSTPASS$ -L $_HOSTAUTH$ -k 1, -k 2, -k 3 Same parameters for different ports k 1 port 1; k 2 for port 2 etc.
Re: Multiple ports in one service
everything you write is correct, except your short question.
Thats not possible to do it like that.
You need a service check for each port, but as you already say, you could use it on multiple hosts.
So if all switches are the same and they would have 48 ports, you would need 48 servicechecks to monitor all ports.
Thats not possible to do it like that.
You need a service check for each port, but as you already say, you could use it on multiple hosts.
So if all switches are the same and they would have 48 ports, you would need 48 servicechecks to monitor all ports.
Rob Hassing


Re: Multiple ports in one service
Yee i thought about that when i write the last post
... but it's fine to have like costume variable macro that will reroute same service for all ports. Thanks for answers again 
Re: Multiple ports in one service
The problem than still would be what service check is acknowledged if you want to acknowledge just one port, and how does it distinct.
You could use a service template to fill in all the same variables, but the port is different for each check.
Hope this helped for you
You could use a service template to fill in all the same variables, but the port is different for each check.
Hope this helped for you
Rob Hassing


Re: Multiple ports in one service
Yes yes solved my mistery, now i have note one problem, Service is not sorted. Service name is mess like start with port 1 then port 12 than port 5,6,7,8 than 11 and 10 etc. I don't know way ... may i open another issue or we can solve it here
Re: Multiple ports in one service
I think it sorts it alphabetically, so it's normal to have 1,10,11,12,13,14,15,16,17,18,19,2,20,21,3,4,5,6,7,8,9 etc
I am not sure how to solve this or how to change this.
Normally i don't look to the order of the ports that are monitored. I only look at problems detected.
Maybe somebody else could help you out?
I am not sure how to solve this or how to change this.
Normally i don't look to the order of the ports that are monitored. I only look at problems detected.
Maybe somebody else could help you out?
Rob Hassing

