Ticket #820 (closed defect: fixed)

Opened 2 years ago

Last modified 3 months ago

error in if_ plugins for Solaris node

Reported by: muhammad Assigned to: bldewolf
Priority: normal Milestone:
Component: plugins Version: 1.4.2
Severity: normal Keywords: if, kstat
Cc:

Description

The 1.4.2 code has "-m link" in the kstat parameter, it return no data on Solaris box.

kstat -p -n $INTERFACE -m link -s '/^[ro]bytes$/' | awk -F: '
{
        split($4, four, "\t")
        print four[1] ".value", four[2]
}'

The old 1.3.4 code did not have it and it works.

kstat -p -n $INTERFACE -s '/^[ro]bytes$/' | awk -F: '
{
        split($4, four, "\t")
        print four[1] ".value", four[2]
}'

Attachments

if_.in.diff (1.3 kB) - added by ja on 03/13/10 17:44:00.
Patch for if_.in

Change History

12/23/09 11:14:31 changed by janl

  • owner changed from nobody to janl.

The 1.3.4 code doesn not work on the solaris machine I have available. What output do you get from this command on your machine (substitute rtls0 with your interface name)?

$ kstat -p -n rtls0 -s '/^[ro]bytes$/'
link:0:rtls0:obytes     18825
link:0:rtls0:rbytes     36763
unix:0:rtls0:obytes     0
unix:0:rtls0:rbytes     0

OpenSolaris? (5.11) here.

03/13/10 17:43:42 changed by ja

Hi,

the code in 1.4.2 was made for OpenSolaris?. In OpenSolaris? the kstat command has the switch -m, which does not exist for kstat in Solaris 10 or earlier.

I suggest the following code snippets (they're maybe not the most efficient, but they make clear, what is meant):

SOLVERSION=`uname -r | awk -F. '{print $2}`


...


if [ "$1" = "suggest" ]; then
        if [ -x /usr/bin/kstat ]; then
                if [ $SOLVERSION -le 10 ]; then
                        kstat -p -s '/^rbytes$/' | awk -F: '{ print $3 }'
                elif [ $SOLVERSION -eq 11 ]; then
                        kstat -m link -p -s '/^rbytes$/' | awk -F: '{ print $3 }'
                fi      
                exit 0
        else    
                exit 1
        fi
fi


...


if [ $SOLVERSION -le 10 ]     # Solaris 10 and earlier
then
        kstat -p -n $INTERFACE -s '/^[ro]bytes$/' | awk -F: '
        {
                split($4, four, "\t")
                print four[1] ".value", four[2]
        }'
elif [ $SOLVERSION -eq 11 ]   # for OpenSolaris
then
        kstat -p -n $INTERFACE -m link -s '/^[ro]bytes$/' | awk -F: '
        {
                split($4, four, "\t")
                print four[1] ".value", four[2]
        }'
fi

The first part handles the "suggest" section, the last one is for reading the statistics.

I attached a patch for that (which should be verified of course).

Juergen

03/13/10 17:44:00 changed by ja

  • attachment if_.in.diff added.

Patch for if_.in

03/13/10 18:19:42 changed by ja

Correction: kstat in Solaris 10 has the switch "-m" but not the module "link". So the output of "kstat -m link ..." is empty on Solaris 10. This is just for info, it doesn't effect the patch.

Juergen

09/27/10 23:29:53 changed by bldewolf

  • owner changed from janl to bldewolf.

09/27/10 23:35:00 changed by bldewolf

  • status changed from new to closed.
  • resolution set to fixed.

I've got some Solaris hosts so I made a proper fix for this and committed it to trunk, r3906 (I'll push it to 1.4 stable too). Instead of sniffing the OS version (there's no guarantee that a version of Solaris 11 won't behave like Solaris 10 again), I put in some more regex magic to the kstat calls.

I've tested it on Solaris 8, 10, and OpenSolaris?. Re-open the bug if there's still problems.

10/27/11 11:31:50 changed by aminanra1984

Anyone who loves films is likely to love film downloads, too. The very fact is that this pattern is turning into a giant one and it is nice for those who wish to create giant collections without having to dole out high dollar or premium house area to do so. How to download video from vimeo are now out there legally from all kinds of big film studios and even tv networks, as well. A video collection created digitally has an a variety of benefits over common disk purchases, too. The biggest perks of video downloads contain the storage points and pricing. However, why? Video downloads are generally just a few dollars or more less than an everyday DVD purchase because there isn't a packaging issues to contend with. Plus, there's the straightforward truth delivery isn't an issue either. Since the corporations that promote downloads save on shipping and the movie studios save on packaging, they will move on some of these financial savings directly to buyers. In regard to storage, it is a easy reality of space. It's an entire lot simpler to retailer movies on a computer drive or a backup drive than it's to carry 100 movies in a room. There is not any want for shelf after shelf or tons of DVD towers when a group is created by way of video download. Administration of movies and television downloads can be a entire lot easier, too. It is fairly simple to create folders on the computer to retailer films by genre and it is an entire lot quicker, too. Video downloads have gotten the favorites of many for a reason past storage or pricing. This reason is variety. The fact is the sorts of downloads out there might be actually thoughts boggling. Let us take a look at what kinds of video downloads could be discovered legally: Hit motion pictures Nearly every new movie that hits the theaters will find yourself in a authorized obtain format shortly after release. This implies there is no have to run to the video retailer, or worse, pay prime greenback at a theater to see a new release. Television packages Vimeo tube downloads Because the movie studios bounce on the bandwagon, so too are the tv studios. Hit reveals from all many years may be found by the season or by the episode via video download.Classics Because the movie download enterprise turns into more in style, many studios are video by means of their catalogues and providing downloads of their older movies. From the classics of the 1920s to holiday favorites of the Nineteen Eighties, they can all be discovered through video download. And, if a title can't be discovered right now, it is probably it is going to be added soon as every major film studio falls into place providing downloads via various completely different sites. Video downloads provide their customers with an on demand side, value savings and storage issue reduction that regular DVD buys cannot. As this new format turns into increasingly accepted, it's becoming the tactic of selection for buying and watching movies. Unique works There are tons of places to get video downloads from novice or little recognized creators. These movies may not have the financial backing of a few of the major motion pictures in historical past, but that does not mean there is not some good entertainment out there. Indie works are getting a whole new viewers thanks to video downloads and the Internet.